Restore support for IE8
IE8 does not support Object.keys. Bug: T86516 Change-Id: Ib1a5df6c1660bc30f7b33f1b794a9229ce31cba6
This commit is contained in:
committed by
[[mw:User:Fomafix]]
parent
ee94df2890
commit
c33ac5fdb4
@@ -354,13 +354,25 @@
|
||||
* @return string
|
||||
*/
|
||||
getMenuWidth: function () {
|
||||
var languagesCount;
|
||||
var language, languagesCount = 0;
|
||||
|
||||
if ( this.options.menuWidth ) {
|
||||
return this.options.menuWidth;
|
||||
}
|
||||
|
||||
languagesCount = Object.keys( this.options.languages ).length;
|
||||
// IE8 does not support Object.keys
|
||||
if ( Object.keys ) {
|
||||
languagesCount = Object.keys( this.options.languages ).length;
|
||||
} else {
|
||||
for ( language in this.options.languages ) {
|
||||
if ( Object.prototype.hasOwnProperty.call(
|
||||
this.options.languages,
|
||||
language
|
||||
) ) {
|
||||
languagesCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( languagesCount < 12 ) {
|
||||
return 'narrow';
|
||||
|
||||
Reference in New Issue
Block a user