1
0

Add equal heights for pluginmanager columns.

Moved firing the syncHeights plugin to a seperate function in the
serendipity namespace because it needs to be fire onclick for the
plugin tabs here. Probably gives us more flexibility in the future
as well. New function is serendipity.sync_heights() which takes no
args.

References #223
This commit is contained in:
Matthias Mees
2014-11-02 11:39:05 +01:00
parent 1c49f0319e
commit 0ce1d8991d
2 changed files with 23 additions and 12 deletions

View File

@ -754,6 +754,20 @@
$(target).toggleClass(stateClass);
}
serendipity.sync_heights = function() {
if($('.equal_heights').length > 0) {
if($('html').hasClass('lt-ie9')) {
$('.equal_heights').syncHeight({
updateOnResize: false
});
} else {
$('.equal_heights').syncHeight({
updateOnResize: true
});
}
}
}
}( window.serendipity = window.serendipity || {}, jQuery ))
$(function() {
@ -1404,17 +1418,14 @@ $(function() {
// Equal Heights
$(window).load(function() {
if (mq_small.matches) {
if($('.equal_heights').length > 0) {
if($('html').hasClass('lt-ie9')) {
$('.equal_heights').syncHeight({
updateOnResize: false
});
} else {
$('.equal_heights').syncHeight({
updateOnResize: true
});
}
}
serendipity.sync_heights();
}
});
// Make sure plugin list heights are recalculated when switching tabs
$('#pluginlist_tabs a').click(function() {
if (mq_small.matches) {
serendipity.sync_heights();
}
});
});

View File

@ -11,7 +11,7 @@
<div class="pluginmanager_side pluginmanager_{($event_only) ? 'event' : 'sidebar'}">
<h4>{$plugin_placement['ptitle']}</h4>
<ol id="{$plugin_placement['pid']}_col" data-placement="{$plugin_placement['pid']}" class="pluginmanager_container plainList">
<ol id="{$plugin_placement['pid']}_col" data-placement="{$plugin_placement['pid']}" class="pluginmanager_container plainList equal_heights">
{foreach $plugin_placement['plugin_data'] as $plugin_data}
<li id="{$plugin_data['css_key']}" class="pluginmanager_plugin pluginmanager_item_{cycle values="odd,even"}">
<input type="hidden" name="serendipity[plugin][{$plugin_data['name']}][id]" value="{$plugin_data['name']}" />