diff --git a/www/file/main.js b/www/file/main.js index 7ae8a622e..2351df39c 100644 --- a/www/file/main.js +++ b/www/file/main.js @@ -17,28 +17,28 @@ define([ var APP = {}; $(function () { -// TODO race condition with contents() here - var ifrw = $('#pad-iframe')[0].contentWindow; - var $iframe = $('#pad-iframe').contents(); - var $form = $iframe.find('#upload-form'); - var $dlform = $iframe.find('#download-form'); - var $label = $form.find('label'); - var $progress = $iframe.find('#progress'); - var $body = $iframe.find('body'); - $body.on('dragover', function (e) { e.preventDefault(); }); - $body.on('drop', function (e) { e.preventDefault(); }); + var andThen = function () { + var ifrw = $('#pad-iframe')[0].contentWindow; + var $iframe = $('#pad-iframe').contents(); + var $form = $iframe.find('#upload-form'); + var $dlform = $iframe.find('#download-form'); + var $label = $form.find('label'); + var $progress = $iframe.find('#progress'); + var $body = $iframe.find('body'); - Cryptpad.addLoadingScreen(); + $body.on('dragover', function (e) { e.preventDefault(); }); + $body.on('drop', function (e) { e.preventDefault(); }); - var Title; + Cryptpad.addLoadingScreen(); - var myFile; - var myDataType; + var Title; - var uploadMode = false; + var myFile; + var myDataType; + + var uploadMode = false; - var andThen = function () { var $bar = $iframe.find('.toolbar-container'); var secret;