diff options
| author | Eole <EoleDev@outlook.fr> | 2016-05-09 23:11:01 +0200 |
|---|---|---|
| committer | Eole <EoleDev@outlook.fr> | 2016-05-09 23:11:01 +0200 |
| commit | e25b446b3d8676ef8be33950f642c42a3d746adf (patch) | |
| tree | 0d26f41ecffeca7a32e9a60d6f7ca67ecbf7f81f | |
| parent | 77ba8021bc4d910afd4d4c9d0a9fe9077c9a00ea (diff) | |
Upload Button and reset progress
| -rwxr-xr-x | client/js/controllers/image/edit.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/client/js/controllers/image/edit.js b/client/js/controllers/image/edit.js index e1da271..be4eb39 100755 --- a/client/js/controllers/image/edit.js +++ b/client/js/controllers/image/edit.js @@ -19,6 +19,10 @@ mainApp.controller('editImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', ' $scope.data.visibility = image.visibility; $scope.axioms = axioms; + $('#progress .bar').css( + 'width', + '0%' + ); $('#editImageModal').modal('show'); $("#fileupload").fileupload({ formData: {task: "image", token: Identity.getToken(), action: "uploadImage", id: $scope.data.id}, @@ -29,7 +33,16 @@ mainApp.controller('editImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', ' 'width', progress + '%' ); - } + }, + add: function (e, data) { + data.process(); + data.context = $('<button/>').text('Upload') + .click(function () { + $(this).detach(); + data.submit(); + }); + $("#fileupload").after(data.context); + }, }); }); |
