mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Make selected tab default when unknown value comes from localStorage
Change-Id: I80ff90242ac386e74a80d36f0656ff9e761fa147
This commit is contained in:
parent
53e965b469
commit
ad1922988b
|
@ -94,7 +94,13 @@
|
||||||
this.ooTabs.embed
|
this.ooTabs.embed
|
||||||
] );
|
] );
|
||||||
|
|
||||||
this.selectedTab = this.getLastUsedTab() || 'download';
|
this.selectedTab = this.getLastUsedTab();
|
||||||
|
|
||||||
|
// In case nothing is saved in localStorage or it contains junk
|
||||||
|
if ( ! this.tabs.hasOwnProperty( this.selectedTab ) ) {
|
||||||
|
this.selectedTab = 'download';
|
||||||
|
}
|
||||||
|
|
||||||
this.reuseTabs.selectItem( this.ooTabs[this.selectedTab] );
|
this.reuseTabs.selectItem( this.ooTabs[this.selectedTab] );
|
||||||
|
|
||||||
if ( this.dependenciesNeedToBeAttached ) {
|
if ( this.dependenciesNeedToBeAttached ) {
|
||||||
|
|
Loading…
Reference in a new issue