Merge "Do not load jquery.jStorage for logged in users"

This commit is contained in:
jenkins-bot
2013-11-12 10:43:57 +00:00
committed by Gerrit Code Review
3 changed files with 18 additions and 7 deletions

View File

@@ -115,13 +115,14 @@
* Initialize
*/
init: function () {
var options;
if ( this.isAnon ) {
this.preferences = $.jStorage.get( this.preferenceName );
this.preferences = $.jStorage.get( this.preferenceName ) || {};
} else {
var options = mw.user.options.get( this.preferenceName );
this.preferences = $.parseJSON( options );
options = mw.user.options.get( this.preferenceName );
this.preferences = $.parseJSON( options ) || {};
}
this.preferences = this.preferences || {};
},
/**
@@ -157,7 +158,6 @@
$.jStorage.set( this.preferenceName, this.preferences );
callback.call( this, true );
} else {
// Logged in user. Use MW APIs to change preferences
saveOptionsWithToken( {
action: 'options',