mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-20 20:39:54 +01:00
Hide view settings if no choices.
This commit is contained in:
parent
dcdcbf703e
commit
a27489c28f
@ -60,9 +60,12 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||
adjustSpacing();
|
||||
}
|
||||
|
||||
function init() {
|
||||
function addViewSettings() {
|
||||
|
||||
if (settings.modes.length < 2 && settings.sizes.length < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $settings = $('#settings');
|
||||
var $viewBlock = $('<div class="block"><h1 class="l10n-view">View</h1></div>');
|
||||
var max;
|
||||
|
||||
@ -93,8 +96,12 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||
.appendTo($viewBlock);
|
||||
}
|
||||
|
||||
$viewBlock.appendTo($settings);
|
||||
$viewBlock.appendTo('#settings');
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
addViewSettings();
|
||||
update();
|
||||
|
||||
event.sub('location.changed', adjustSpacing);
|
||||
|
Loading…
x
Reference in New Issue
Block a user