This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
Backbone.syncWithoutUpload = Backbone.sync | |
Backbone.syncWithUpload = function(method, model, options) { | |
// Create iframe | |
var iframe_id = 'file_upload_iframe_' + Date.now() | |
, iframe = jQuery('<iframe id="' + iframe_id + '" name="' + iframe_id + '" ></iframe>').hide() | |
// Create an hidden form | |
var authToken = jQuery('meta[name=csrf-token]').attr('content') | |
, authParam = jQuery('meta[name=csrf-param]').attr('content') |