Merge "Handle window.localStorage === null case correctly."

This commit is contained in:
jenkins-bot 2014-04-29 07:10:33 +00:00 committed by Gerrit Code Review
commit 8b7cfd12d5

View file

@ -37,8 +37,7 @@
* @property {boolean}
* @private
*/
this.hasAnimatedMetadata = window.localStorage === undefined ||
localStorage.getItem( 'mmv.hasOpenedMetadata' );
this.hasAnimatedMetadata = !window.localStorage || localStorage.getItem( 'mmv.hasOpenedMetadata' );
/** @property {mw.mmv.HtmlUtils} htmlUtils - */
this.htmlUtils = new mw.mmv.HtmlUtils();
@ -829,7 +828,7 @@
if (
!this.savedHasOpenedMetadata &&
scrolled &&
window.localStorage !== undefined
window.localStorage
) {
localStorage.setItem( 'mmv.hasOpenedMetadata', true );
this.savedHasOpenedMetadata = true;