mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-29 07:59:31 +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) {
|
if(this.height() === 0) {
|
||||||
text = ss.i18n._t('UploadField.Editing', "Editing ...");
|
text = ss.i18n._t('UploadField.Editing', "Editing ...");
|
||||||
this.fitHeight();
|
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');
|
status.removeClass('ui-state-success-text').removeClass('ui-state-warning-text');
|
||||||
iframe.find('#Form_EditForm_action_doEdit').click(function(){
|
iframe.find('#Form_EditForm_action_doEdit').click(function(){
|
||||||
itemInfo.find('label .name').text(iframe.find('#Name input').val());
|
itemInfo.find('label .name').text(iframe.find('#Name input').val());
|
||||||
|
@ -467,6 +468,7 @@
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.animate({height: 0}, 500);
|
this.animate({height: 0}, 500);
|
||||||
|
this.removeClass('opened');
|
||||||
itemInfo.find('.toggle-details-icon').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');
|
$('div.ss-upload .ss-uploadfield-item-edit-all').removeClass('opened').find('.toggle-details-icon').removeClass('opened');
|
||||||
if(!this.hasClass('edited')){
|
if(!this.hasClass('edited')){
|
||||||
|
@ -490,9 +492,11 @@
|
||||||
});
|
});
|
||||||
$('div.ss-upload .ss-uploadfield-item-editform iframe').entwine({
|
$('div.ss-upload .ss-uploadfield-item-editform iframe').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
|
var form = this.closest('.ss-uploadfield-item-editform');
|
||||||
// TODO entwine event binding doesn't work for iframes
|
// TODO entwine event binding doesn't work for iframes
|
||||||
this.load(function() {
|
this.load(function() {
|
||||||
$(this).parent().removeClass('loading');
|
$(this).parent().removeClass('loading');
|
||||||
|
if(form.hasClass('opened')) form.fitHeight();
|
||||||
});
|
});
|
||||||
this._super();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user