Simplify getMenuWidth()
This commit is contained in:
@@ -395,21 +395,21 @@
|
|||||||
getMenuWidth: function () {
|
getMenuWidth: function () {
|
||||||
var menuWidth, languagesCount;
|
var menuWidth, languagesCount;
|
||||||
|
|
||||||
menuWidth = this.options.menuWidth;
|
if ( this.options.menuWidth ) {
|
||||||
|
return this.options.menuWidth;
|
||||||
if ( !menuWidth ) {
|
|
||||||
languagesCount = Object.keys( this.options.languages ).length;
|
|
||||||
|
|
||||||
if ( languagesCount < 12 ) {
|
|
||||||
menuWidth = 'narrow';
|
|
||||||
} else if ( languagesCount < 100 ) {
|
|
||||||
menuWidth = 'medium';
|
|
||||||
} else {
|
|
||||||
menuWidth = 'wide';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return menuWidth;
|
languagesCount = Object.keys( this.options.languages ).length;
|
||||||
|
|
||||||
|
if ( languagesCount < 12 ) {
|
||||||
|
return 'narrow';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( languagesCount < 100 ) {
|
||||||
|
return 'medium';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'wide';
|
||||||
},
|
},
|
||||||
|
|
||||||
isMobile: function () {
|
isMobile: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user