2016-04-19 21:04:43 +12:00
|
|
|
import $ from '../jQuery';
|
2016-01-11 14:25:30 +13:00
|
|
|
|
|
|
|
$('.ss-assetuploadfield').entwine({
|
|
|
|
onmatch: function() {
|
|
|
|
this._super();
|
2016-04-19 21:04:43 +12:00
|
|
|
|
2016-01-11 14:25:30 +13:00
|
|
|
// 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;
|
2016-04-19 21:04:43 +12:00
|
|
|
|
2016-01-11 14:25:30 +13:00
|
|
|
allowedExt.toggleClass('active');
|
|
|
|
allowedExt.find('.toggle-content').css('minHeight', minHeightVal);
|
|
|
|
}
|
|
|
|
});
|