couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [3/3] git commit: updated refs/heads/master to 8a1118e
Date Fri, 20 Sep 2013 14:52:25 GMT
show upload errors


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8a1118e1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8a1118e1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8a1118e1

Branch: refs/heads/master
Commit: 8a1118e18790295f9094b16afe74d9f8a7fec479
Parents: faa65cd
Author: Garren Smith <garren.smith@gmail.com>
Authored: Thu Sep 19 16:47:31 2013 +0200
Committer: suelockwood <deathbearbrown@gmail.com>
Committed: Fri Sep 20 10:52:15 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js            | 9 ++++++---
 src/fauxton/app/templates/documents/upload_modal.html | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1118e1/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index de19386..c70e94e 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -147,6 +147,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror,
JSHint, re
       event.preventDefault();
 
       var docRev = this.model.get('_rev'),
+          that = this,
           $form = this.$('#file-upload');
 
       if (!docRev) {
@@ -165,21 +166,23 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror,
JSHint, re
         beforeSend: this.beforeSend,
         uploadProgress: this.uploadProgress,
         success: this.success,
-        error: function () {
-          console.log('ERR on upload', arguments);
+        error: function (resp) {
+          console.log('ERR on upload', resp);
+          return that.set_error_msg('Could not upload document: ' + JSON.parse(resp.responseText).reason);
         }
       });
     },
 
     success: function (resp) {
       var hideModal = this.hideModal,
-      $form = this.$('#file-upload');
+          $form = this.$('#file-upload');
 
       FauxtonAPI.triggerRouteEvent('reRenderDoc');
       //slight delay to make this transistion a little more fluid and less jumpy
       setTimeout(function () {
         $form.clearForm();
         hideModal();
+        $('.modal-backdrop').remove();
       }, 1000);
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1118e1/src/fauxton/app/templates/documents/upload_modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/upload_modal.html b/src/fauxton/app/templates/documents/upload_modal.html
index 08a14a6..33c2861 100644
--- a/src/fauxton/app/templates/documents/upload_modal.html
+++ b/src/fauxton/app/templates/documents/upload_modal.html
@@ -18,7 +18,7 @@ the License.
     <h3>Upload an Attachment</h3>
   </div>
   <div class="modal-body">
-    <div id="modal-error" class="hide alert alert-error"/>
+    <div id="modal-error" class="alert alert-error hide" style="font-size: 16px;">
</div>
     <form id="file-upload" class="form" method="post">
       <p class="help-block">
       Please select the file you want to upload as an attachment to this document. 


Mime
View raw message