Fixed UploadField JS dependencies

When adding the deps straight into the file (recommended),
the onchange handler in file-upload isn't firing properly when a file is uploaded through
the <input type=file> button - it falls back to default behaviour, which submits the
containing form, failing because the upload is handled by a different URL.
This commit is contained in:
Ingo Schommer 2016-09-10 17:05:24 +12:00
parent 25b511f3d5
commit 701c700d4c
2 changed files with 12 additions and 8 deletions

View File

@ -51,7 +51,18 @@ require('../../../../thirdparty/jquery-changetracker/lib/jquery.changetracker.js
require('../../../../client/src/legacy/TreeDropdownField.js'); require('../../../../client/src/legacy/TreeDropdownField.js');
require('../../../../client/src/legacy/DateField.js'); require('../../../../client/src/legacy/DateField.js');
// TODO Move UploadField.js deps into the file once figuring out why uploads fail then
require('../../../../thirdparty/jquery-ui/jquery-ui.js');
require('../../../../admin/client/src/legacy/ssui.core.js');
require('imports?define=>false&this=>window!blueimp-load-image/load-image.js');
require('blueimp-file-upload/jquery.iframe-transport.js');
require('blueimp-file-upload/cors/jquery.xdr-transport.js');
require('blueimp-file-upload/jquery.fileupload.js');
require('blueimp-file-upload/jquery.fileupload-ui.js');
require('../../../../client/src/legacy/UploadField.js'); require('../../../../client/src/legacy/UploadField.js');
require('../../../../client/src/legacy/HtmlEditorField.js'); require('../../../../client/src/legacy/HtmlEditorField.js');
require('../../../../client/src/legacy/TabSet.js'); require('../../../../client/src/legacy/TabSet.js');
require('../legacy/ssui.core.js'); require('../legacy/ssui.core.js');

View File

@ -1,16 +1,9 @@
import $ from 'jQuery'; import $ from 'jQuery';
import i18n from 'i18n'; import i18n from 'i18n';
// entwine also required, but can't be included more than once without error // TODO Move deps from lib.js into the file once figuring out why uploads fail then
require('../../../thirdparty/jquery-ui/jquery-ui.js');
require('../../../admin/client/src/legacy/ssui.core.js');
window.tmpl = require('blueimp-tmpl/tmpl.js'); window.tmpl = require('blueimp-tmpl/tmpl.js');
require('imports?define=>false&this=>window!blueimp-load-image/load-image.js');
require('blueimp-file-upload/jquery.iframe-transport.js');
require('blueimp-file-upload/cors/jquery.xdr-transport.js');
require('blueimp-file-upload/jquery.fileupload.js');
require('blueimp-file-upload/jquery.fileupload-ui.js');
require('./UploadField_uploadtemplate.js'); require('./UploadField_uploadtemplate.js');
require('./UploadField_downloadtemplate.js'); require('./UploadField_downloadtemplate.js');