From 172072df035fa076a967e5b986f563cd8b77b1ac Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Fri, 21 Oct 2016 14:08:42 +1300 Subject: [PATCH] Remove JS from filter height and replace with flexbox --- client/dist/js/bundle.js | 7 +++---- client/src/legacy/CMSMain.Tree.js | 13 ------------- .../CMS/Controllers/Includes/CMSMain_Tools.ss | 4 ++-- .../CMS/Controllers/Includes/CMSMain_TreeView.ss | 2 +- .../Includes/CMSPagesController_Content.ss | 4 ++-- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 9718d992..15a5cb66 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -123,10 +123,9 @@ label:r["default"]._t("Tree.Duplicate"),submenu:[{label:r["default"]._t("Tree.Th }},{label:r["default"]._t("Tree.ThisPageAndSubpages"),action:function f(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(r["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams"))) }}]}),i}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function a(){var t=this,e=t.parents(".cms-panel-content"),n;(t.offset().top<0||t.offset().top>e.height()-t.height())&&(n=e.scrollTop()+t.offset().top+e.height()/2, -e.animate({scrollTop:n},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function o(){window.location=location.protocol+"//"+location.host+location.pathname}}),t(".cms-tree-filtered").entwine({ -onmatch:function s(){var e=this,n=function i(){var n=t(".cms-content-tools .cms-panel-content").height()-e.parent().siblings(".cms-content-toolbar").outerHeight(!0) -e.css("height",n+"px")} -n(),t(window).on("resize",window.ss.debounce(n,300))}})})},function(t,e,n){"use strict" +e.animate({scrollTop:n},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function o(){window.location=location.protocol+"//"+location.host+location.pathname}})})},function(t,e,n){"use strict" + + function i(t){return t&&t.__esModule?t:{"default":t}}var a=n(2),o=i(a),s=n(5),r=i(s) o["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function e(){this._super()},onunmatch:function n(){this._super()},onsubmit:function i(e,n){e.preventDefault() var i,a=this diff --git a/client/src/legacy/CMSMain.Tree.js b/client/src/legacy/CMSMain.Tree.js index adedf9e3..e8363a40 100644 --- a/client/src/legacy/CMSMain.Tree.js +++ b/client/src/legacy/CMSMain.Tree.js @@ -163,17 +163,4 @@ $.entwine('ss.tree', function($){ window.location = location.protocol + '//' + location.host + location.pathname; } }); - - $('.cms-tree-filtered').entwine({ - onmatch: function () { - var self = this, - setHeight = function () { - var height = $('.cms-content-tools .cms-panel-content').height() - self.parent().siblings('.cms-content-toolbar').outerHeight(true); - self.css('height', height + 'px'); - }; - - setHeight(); - $(window).on('resize', window.ss.debounce(setHeight, 300)); - } - }); }); diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss index a697240b..e381553e 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss @@ -14,12 +14,12 @@ -
+
$SearchForm
-
+
<%-- Lazy-loaded via ajax --%>
diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_TreeView.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_TreeView.ss index c9eca6dd..bad37c6c 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_TreeView.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_TreeView.ss @@ -6,7 +6,7 @@ $ExtraTreeTools -
+
<% if $TreeIsFiltered %>
<% _t('CMSMain.TreeFiltered', 'Showing search results.') %> diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss index 3bbc3f54..8d5b0aae 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss @@ -20,10 +20,10 @@
-
+
$Tools -
+
<%-- Lazy-loaded via ajax --%>