Skip to content

Commit

Permalink
Disable post button while images are being uploaded. This is to preve…
Browse files Browse the repository at this point in the history
…nt duplicate images from being uploaded
  • Loading branch information
hegek87 committed Feb 8, 2016
1 parent 43616dc commit d4c4b4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mobile/www/app/components/post/post.controller.js
Expand Up @@ -16,6 +16,7 @@
attachmentIds: []
};
vm.images = [];
vm.isPosting = false;

vm.post = post;
vm.reset = reset;
Expand Down Expand Up @@ -44,6 +45,7 @@
attachmentIds: []
};
vm.images = [];
vm.isPosting = false;
}

function close() {
Expand Down Expand Up @@ -75,6 +77,7 @@
function upload() {
var promises = [];
var deferred = $q.defer();
vm.isPosting = true;

var options = new FileUploadOptions();
var fileTransfer = new FileTransfer();
Expand Down
2 changes: 1 addition & 1 deletion mobile/www/app/components/post/post.html
Expand Up @@ -35,7 +35,7 @@
</div>

<h1 class="title" style="opacity: 0.5;">{{ vm.charCount - vm.status.content.length }}</h1>
<button class="button button-positive" ng-disabled="vm.status.content.length === 0 || !vm.status.content" ng-click="vm.post()">
<button class="button button-positive" ng-disabled="vm.status.content.length === 0 || !vm.status.content || vm.isPosting" ng-click="vm.post()">
Post
</button>
</ion-footer-bar>
Expand Down

0 comments on commit d4c4b4b

Please sign in to comment.