Merge pull request #1658 from open-sausages/pulls/4.0/search-bg

Remove JS from filter height and replace with flexbox
This commit is contained in:
Damian Mooyman 2016-10-26 14:27:36 +13:00 committed by GitHub
commit 7c6eec3a01
5 changed files with 34 additions and 50 deletions

View File

@ -84,10 +84,10 @@ n.data("button")&&n.button("option","showingAlternate",!1),this._super(t)}}),t("
}}),t(".cms-edit-form .btn-toolbar button[name=action_save]").entwine({onbuttonafterrefreshalternate:function P(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")
}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function T(){this.redraw(),this._super()},onunmatch:function S(){this._super()},redraw:function x(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder")
}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function T(){this.redraw(),this._super()},onunmatch:function S(){this._super()},redraw:function k(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder")
"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function k(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()
"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function x(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()
})},function(t,e){t.exports=i18n},function(t,e,n){"use strict"
function i(t){return t&&t.__esModule?t:{"default":t}}var a=n(2),o=i(a)
@ -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

View File

@ -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));
}
});
});

View File

@ -14,12 +14,12 @@
</div>
</div>
</div>
<div class="panel panel--scrollable flexbox-area-grow cms-panel-content">
<div class="panel panel--scrollable flexbox-area-grow fill-height cms-panel-content">
<div class="cms-content-filters">
$SearchForm
</div>
<div class="panel panel--padded cms-content-view cms-tree-view-sidebar cms-panel-deferred" id="cms-content-treeview" data-url="$LinkTreeView">
<div class="panel panel--padded panel--scrollable flexbox-area-grow fill-height cms-content-view cms-tree-view-sidebar cms-panel-deferred" id="cms-content-treeview" data-url="$LinkTreeView">
<%-- Lazy-loaded via ajax --%>
</div>
</div>

View File

@ -6,31 +6,12 @@
$ExtraTreeTools
<div class="center">
<% if $TreeIsFiltered %>
<div class="cms-tree-filtered cms-notice">
<strong><% _t('CMSMain.TreeFiltered', 'Showing search results.') %></strong>
<a href="javascript:void(0)" class="clear-filter">
<% _t('CMSMain.TreeFilteredClear', 'Clear') %>
</a>
<div class="cms-tree <% if $TreeIsFiltered %>filtered-list<% end_if %>"
data-url-tree="$LinkWithSearch($Link(getsubtree)).ATT"
data-url-savetreenode="$Link(savetreenode).ATT"
data-url-updatetreenodes="$Link(updatetreenodes).ATT"
data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1', 'ParentID=%s&amp;PageType=%s').ATT}"
data-url-editpage="$LinkPageEdit('%s').ATT"
data-url-duplicate="{$Link('duplicate/%s').ATT}"
data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s').ATT}"
data-url-listview="{$Link('?view=list').ATT}"
data-hints="$SiteTreeHints.ATT"
data-childfilter="$Link('childfilter').ATT"
data-extra-params="SecurityID=$SecurityID.ATT">
$SiteTreeAsUL
</div>
</div>
<% else %>
<% if $TreeIsFiltered %>
<div class="cms-tree-filtered cms-notice flexbox-area-grow">
<strong><% _t('CMSMain.TreeFiltered', 'Showing search results.') %></strong>
<a href="javascript:void(0)" class="clear-filter">
<% _t('CMSMain.TreeFilteredClear', 'Clear') %>
</a>
<div class="cms-tree <% if $TreeIsFiltered %>filtered-list<% end_if %>"
data-url-tree="$LinkWithSearch($Link(getsubtree)).ATT"
@ -46,6 +27,23 @@ $ExtraTreeTools
data-extra-params="SecurityID=$SecurityID.ATT">
$SiteTreeAsUL
</div>
<% end_if %>
</div>
<% else %>
<div class="cms-tree flexbox-area-grow <% if $TreeIsFiltered %>filtered-list<% end_if %>"
data-url-tree="$LinkWithSearch($Link(getsubtree)).ATT"
data-url-savetreenode="$Link(savetreenode).ATT"
data-url-updatetreenodes="$Link(updatetreenodes).ATT"
data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1', 'ParentID=%s&amp;PageType=%s').ATT}"
data-url-editpage="$LinkPageEdit('%s').ATT"
data-url-duplicate="{$Link('duplicate/%s').ATT}"
data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s').ATT}"
data-url-listview="{$Link('?view=list').ATT}"
data-hints="$SiteTreeHints.ATT"
data-childfilter="$Link('childfilter').ATT"
data-extra-params="SecurityID=$SecurityID.ATT">
$SiteTreeAsUL
</div>
<% end_if %>

View File

@ -20,10 +20,10 @@
</div>
</div>
<div class="cms-content-fields center ui-widget-content cms-panel-padded">
<div class="cms-content-fields center ui-widget-content cms-panel-padded flexbox-area-grow fill-height">
$Tools
<div class="cms-content-view cms-panel-deferred" id="cms-content-treeview" data-url="$LinkTreeView" data-deferred-no-cache="true">
<div class="cms-content-view cms-panel-deferred fill-height flexbox-display" id="cms-content-treeview" data-url="$LinkTreeView" data-deferred-no-cache="true">
<%-- Lazy-loaded via ajax --%>
</div>