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();
|
||||
}
|
||||
|
||||
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…
Add table
Reference in a new issue