BUGFIX: Fixed tab layout for add form of model admin

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@76841 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-14 05:18:50 +00:00
parent e99ef98e89
commit 1a1229cd96
3 changed files with 11 additions and 3 deletions

View File

@ -112,7 +112,7 @@ input.hidden {
}
/* Overrides - TODO Find a better place to put them */
form#Form_EditForm fieldset {
form#Form_EditForm fieldset, form#Form_AddForm fieldset {
height: 100%;
border: none;
}

View File

@ -126,6 +126,7 @@ Behaviour.register({
window.ontabschanged = function() {
var formEl = $('Form_EditForm');
if( !formEl ) formEl = $('Form_AddForm');
if( !formEl )
return;
@ -156,7 +157,7 @@ window.onresize = function(init) {
if(typeof fitToParent == 'function') {
fitToParent('right', 12);
if($('ModelAdminPanel')) {
fitToParent('ModelAdminPanel',-30);
fitToParent('ModelAdminPanel',-60);
}
if($('contentPanel')) {
fitToParent('contentPanel', 12);
@ -175,7 +176,9 @@ window.onresize = function(init) {
}
if(typeof fitToParent == 'function') {
fitToParent('Form_EditForm', 4);
if($('Form_EditForm')) fitToParent('Form_EditForm', 4);
if($('Form_AddForm')) fitToParent('Form_AddForm', 4);
if($('Form_EditorToolbarImageForm') && $('Form_EditorToolbarImageForm').style.display == "block") {
fitToParent('Form_EditorToolbarImageForm', 5);
fitToParent($('Form_EditorToolbarImageForm').getElementsByTagName('fieldset')[0]);

View File

@ -82,6 +82,8 @@ $(document).ready(function() {
* to the response table, excluding the import form because
* file ($_FILES) submission doesn't work using AJAX
*
* Note: This is used for Form_CreateForm too
*
* @todo use livequery to manage ResultTable click handlers
*/
$('#SearchForm_holder .tab form:not(#Form_ImportForm)').submit(function () {
@ -98,6 +100,8 @@ $(document).ready(function() {
$('#form_actions_right').remove();
Behaviour.apply();
console.log(window.onresize);
if(window.onresize) window.onresize();
// Remove the loading indicators from the buttons
$('input[type=submit]', $form).removeClass('loading');
},
@ -204,6 +208,7 @@ $(document).ready(function() {
// TODO/SAM: It seems a bit of a hack to have to list all the little updaters here.
// Is livequery a solution?
Behaviour.apply(); // refreshes ComplexTableField
if(window.onresize) window.onresize();
}, 'html');
return false;