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:
Ingo Schommer 2013-10-23 11:16:47 +02:00
parent d2360ec8aa
commit 3422761a41

View File

@ -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();
},