mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed UploadField edit forms falsely expanding by default
This commit is contained in:
parent
f8201c48a3
commit
0b0e24b0ec
@ -196,18 +196,26 @@
|
||||
}
|
||||
});
|
||||
$('div.ss-upload .ss-uploadfield-item-editform').entwine({
|
||||
fitHeight: function() {
|
||||
var iframe = this.find('iframe'), h = iframe.contents().height();
|
||||
// Set iframe to match its contents height
|
||||
iframe.height(h);
|
||||
// set container to match the same height
|
||||
iframe.parent().height(h);
|
||||
},
|
||||
toggleEditForm: function() {
|
||||
jQuery(this).toggle();
|
||||
if(this.height() === 0) {
|
||||
this.fitHeight();
|
||||
} else {
|
||||
this.height(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('div.ss-upload .ss-uploadfield-item-editform iframe').entwine({
|
||||
onmatch: function() {
|
||||
// TODO entwine event binding doesn't work for iframes
|
||||
this.load(function() {
|
||||
var iframe = $(this), h = iframe.contents().height();
|
||||
// Set iframe to match its contents height
|
||||
iframe.height(h);
|
||||
// set container to match the same height
|
||||
iframe.parent().removeClass('loading').height(h);
|
||||
$(this).parent().removeClass('loading');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user