Merge branch 'SPR-935' into 'master'
SPR-935, SPR-949 See merge request !43
This commit is contained in:
commit
931ed0511c
2 changed files with 51 additions and 25 deletions
|
@ -27,6 +27,10 @@
|
||||||
|
|
||||||
bdi {
|
bdi {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
max-width: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: auto;
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
jQuery(function () {
|
|
||||||
var $metaBox = jQuery('#spr__meta-box');
|
|
||||||
if (!$metaBox.length) return;
|
(function($) {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the click handler for the tabs
|
* Register the click handler for the tabs
|
||||||
|
@ -8,9 +9,11 @@ jQuery(function () {
|
||||||
* Tabs can be added dynamically later on and this handler will still
|
* Tabs can be added dynamically later on and this handler will still
|
||||||
* provide the open/close functionality
|
* provide the open/close functionality
|
||||||
*/
|
*/
|
||||||
|
var registerClickForTabsInMetaBox = function($metaBox) {
|
||||||
|
|
||||||
$metaBox.on('click', '.meta-tabs a', function (e) {
|
$metaBox.on('click', '.meta-tabs a', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var $tab = jQuery(this),
|
var $tab = $(this),
|
||||||
isopen = $tab.attr('aria-expanded') === 'true';
|
isopen = $tab.attr('aria-expanded') === 'true';
|
||||||
|
|
||||||
// disable all existing tabs
|
// disable all existing tabs
|
||||||
|
@ -35,5 +38,24 @@ jQuery(function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* in admin templates show toc tab, if available
|
||||||
|
*/
|
||||||
|
if($('body').hasClass('do-admin')) {
|
||||||
|
var $tocLink = $metaBox.find('a[href="#spr__tab-toc"]');
|
||||||
|
if($tocLink.length === 1) {
|
||||||
|
$tocLink.trigger('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
var $metaBox = $('#spr__meta-box');
|
||||||
|
if (!$metaBox.length) return;
|
||||||
|
|
||||||
|
registerClickForTabsInMetaBox($metaBox);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue