mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
2140025c20
- Adds ES6 support via Babel - Transforms existing JavaScript to UMD modules - Adds module bundling via Browserify - Existing JavaScript converted to UMD modules - lib.js and leftandmain.js are bundled using browserify - JavaScript minifying of bundles handed by gulp
30 lines
805 B
JavaScript
30 lines
805 B
JavaScript
import $ from './jQuery';
|
|
|
|
$('.ss-assetuploadfield').entwine({
|
|
onmatch: function() {
|
|
this._super();
|
|
|
|
// Hide the "second step" part until we're actually uploading
|
|
this.find('.ss-uploadfield-editandorganize').hide();
|
|
},
|
|
onunmatch: function() {
|
|
this._super();
|
|
},
|
|
onfileuploadadd: function(e) {
|
|
this.find('.ss-uploadfield-editandorganize').show();
|
|
},
|
|
onfileuploadstart: function(e) {
|
|
this.find('.ss-uploadfield-editandorganize').show();
|
|
}
|
|
});
|
|
|
|
$('.ss-uploadfield-view-allowed-extensions .toggle').entwine({
|
|
onclick: function(e) {
|
|
var allowedExt = this.closest('.ss-uploadfield-view-allowed-extensions'),
|
|
minHeightVal = this.closest('.ui-tabs-panel').height() + 20;
|
|
|
|
allowedExt.toggleClass('active');
|
|
allowedExt.find('.toggle-content').css('minHeight', minHeightVal);
|
|
}
|
|
});
|