mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
Hide view settings if no choices.
This commit is contained in:
parent
dcdcbf703e
commit
a27489c28f
1 changed files with 10 additions and 3 deletions
|
@ -60,9 +60,12 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||||
adjustSpacing();
|
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 $viewBlock = $('<div class="block"><h1 class="l10n-view">View</h1></div>');
|
||||||
var max;
|
var max;
|
||||||
|
|
||||||
|
@ -93,8 +96,12 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||||
.appendTo($viewBlock);
|
.appendTo($viewBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
$viewBlock.appendTo($settings);
|
$viewBlock.appendTo('#settings');
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
addViewSettings();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
event.sub('location.changed', adjustSpacing);
|
event.sub('location.changed', adjustSpacing);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue