Scrolling fixes for Model Admin

This commit is contained in:
Christopher Joe 2016-10-10 16:04:49 +13:00 committed by Damian Mooyman
parent eee9ffaaa2
commit bb2f487644
3 changed files with 11 additions and 18 deletions

View File

@ -254,7 +254,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
'type' => 'Includes', 'type' => 'Includes',
'SilverStripe\\Admin\\LeftAndMain_EditForm', 'SilverStripe\\Admin\\LeftAndMain_EditForm',
]); ]);
$form->addExtraClass('cms-content cms-edit-form center flexbox-area-grow'); $form->addExtraClass('cms-content cms-edit-form center fill-height flexbox-area-grow');
$form->setAttribute('data-pjax-fragment', 'CurrentForm Content'); $form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
if ($form->Fields()->hasTabSet()) { if ($form->Fields()->hasTabSet()) {
$form->Fields()->findOrMakeTab('Root')->setTemplate('SilverStripe\\Forms\\CMSTabSet'); $form->Fields()->findOrMakeTab('Root')->setTemplate('SilverStripe\\Forms\\CMSTabSet');

View File

@ -1447,22 +1447,15 @@ $.entwine('ss', function($) {
$filters = $('.cms-content-filters').first(), $filters = $('.cms-content-filters').first(),
collapsed = this.data('collapsed'); collapsed = this.data('collapsed');
// Prevent the user from spamming the UI with animation requests. // previously using "slideDown"/"slideUp" jQuery, but it was causing issues
if (this.data('animating')) { if (collapsed) {
return; this.addClass('active');
$filters.css('display', 'block');
} else {
this.removeClass('active');
$filters.css('display', '');
} }
self.data('collapsed', !collapsed);
this.toggleClass('active');
this.data('animating', true);
// Slide the element down / up based on it's current collapsed state.
$filters[collapsed ? 'slideDown' : 'slideUp']({
complete: function () {
// Update the element's state.
self.data('collapsed', !collapsed);
self.data('animating', false);
}
});
}, },
onclick: function () { onclick: function () {
this.showHide(); this.showHide();

View File

@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div class="cms-content-fields center ui-widget-content cms-panel-padded" data-layout-type="border"> <div class="cms-content-fields center ui-widget-content cms-panel-padded fill-height" data-layout-type="border">
$Tools $Tools
<div class="cms-content-view"> <div class="cms-content-view">