From 95a76e11dea32cd00b77f3a3e18148bdbfa5e4ff Mon Sep 17 00:00:00 2001 From: micmania1 Date: Thu, 4 Feb 2016 22:22:30 +0000 Subject: [PATCH] FIX Success/error message overflow in cms --- js/cms.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/js/cms.js b/js/cms.js index 15bae53..ead83f3 100644 --- a/js/cms.js +++ b/js/cms.js @@ -2,6 +2,22 @@ $.entwine('ss', function ($) { + /** + * The page success/error message sits outside of the html block + * containing the sidebar and cms fields. This means it overflows + * underneath the sidebar. + * + * @see https://github.com/silverstripe/silverstripe-blog/issues/210 + */ + $('.cms-content-fields > #Form_EditForm_error').entwine({ + 'onadd': function() { + var $target = $('.blog-admin-outer'); + if($target.length == 1) { + $target.prepend(this); + } + } + }); + /** * Register expandable help text functions with fields. */ @@ -44,7 +60,7 @@ $this.parent().next('.description').addClass('toggle-description-correct-description'); } }); - + /** * Custom merge actions for tags and categories */ @@ -81,10 +97,10 @@ }); } }); - + /** * Customise the cms-panel behaviour for blog sidebar - * + * * see LeftAndMain.Panel.js for base behaviour */ $('.blog-admin-sidebar.cms-panel').entwine({ @@ -92,7 +108,7 @@ onadd: function() { this._super(); this.updateLayout(); - + // If this panel is open and the left hand column is smaller than the minimum, contract it instead if(!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getminInnerWidth())) { this.collapsePanel(); @@ -104,7 +120,7 @@ }, /** * Adjust minimum width of content to account for extra panel - * + * * @returns {undefined} */ updateLayout: function() {