diff options
| author | mo khan <mo@mokhan.ca> | 2014-06-18 20:44:47 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-06-18 20:44:47 -0600 |
| commit | d162cdeabd184292320baf378f0e2c8a7bb61bb7 (patch) | |
| tree | 286b5aac0ab92afe83b5995fa5fde7be84676425 /vendor | |
| parent | 4937ef0fbb2c1815779380159bb8c1280439672a (diff) | |
upload new photo using collection create.
Diffstat (limited to 'vendor')
| -rw-r--r-- | vendor/assets/javascripts/backbone-model-file-upload.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vendor/assets/javascripts/backbone-model-file-upload.js b/vendor/assets/javascripts/backbone-model-file-upload.js index 6c9d4aae..27367076 100644 --- a/vendor/assets/javascripts/backbone-model-file-upload.js +++ b/vendor/assets/javascripts/backbone-model-file-upload.js @@ -4,12 +4,11 @@ // https://github.com/homeslicesolutions/backbone-model-file-upload !function(_, Backbone){ - // Clone the original Backbone.Model.prototype var backboneModelClone = _.clone( Backbone.Model.prototype ); // Extending out - _.extend(Backbone.Model.prototype, { + _.extend(Backbone.Model.prototype, { // ! Default file attribute - can be overwritten fileAttribute: 'file', @@ -81,7 +80,6 @@ // Continue to call the existing "save" method return backboneModelClone.save.call(this, attrs, options); - }, // _ FlattenObject gist by "penguinboy". Thank You! @@ -103,15 +101,15 @@ return output; }, - + // _ Get the Progress of the uploading file _progressHandler: function( event ) { + console.log(event); if (event.lengthComputable) { var percentComplete = event.loaded / event.total; + console.log("triggering... " + percentComplete); this.trigger( 'progress', percentComplete ); } } - }); - }(_, Backbone); |
