mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Adjust UploadField edit form size
Thanks @kinglozzer for getting this started. Fixes https://github.com/silverstripe/silverstripe-cms/issues/878 Replaces https://github.com/silverstripe/silverstripe-framework/pull/2221
This commit is contained in:
parent
d2360ec8aa
commit
3422761a41
@ -456,7 +456,8 @@
|
||||
if(this.height() === 0) {
|
||||
text = ss.i18n._t('UploadField.Editing', "Editing ...");
|
||||
this.fitHeight();
|
||||
itemInfo.find('.toggle-details-icon').addClass('opened');
|
||||
this.addClass('opened');
|
||||
itemInfo.find('.toggle-details-icon').addClass('opened');
|
||||
status.removeClass('ui-state-success-text').removeClass('ui-state-warning-text');
|
||||
iframe.find('#Form_EditForm_action_doEdit').click(function(){
|
||||
itemInfo.find('label .name').text(iframe.find('#Name input').val());
|
||||
@ -467,6 +468,7 @@
|
||||
|
||||
} else {
|
||||
this.animate({height: 0}, 500);
|
||||
this.removeClass('opened');
|
||||
itemInfo.find('.toggle-details-icon').removeClass('opened');
|
||||
$('div.ss-upload .ss-uploadfield-item-edit-all').removeClass('opened').find('.toggle-details-icon').removeClass('opened');
|
||||
if(!this.hasClass('edited')){
|
||||
@ -490,9 +492,11 @@
|
||||
});
|
||||
$('div.ss-upload .ss-uploadfield-item-editform iframe').entwine({
|
||||
onmatch: function() {
|
||||
var form = this.closest('.ss-uploadfield-item-editform');
|
||||
// TODO entwine event binding doesn't work for iframes
|
||||
this.load(function() {
|
||||
$(this).parent().removeClass('loading');
|
||||
$(this).parent().removeClass('loading');
|
||||
if(form.hasClass('opened')) form.fitHeight();
|
||||
});
|
||||
this._super();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user