Oops I missed a couple of jshint errors :)

This commit is contained in:
Robin Ward 2013-02-25 17:53:06 -05:00
parent 2a7345b96e
commit 3e201fc9f3
2 changed files with 10 additions and 10 deletions

View File

@ -4,25 +4,25 @@
@class KeyValueStore
@namespace Discourse
@module Discourse
**/
**/
Discourse.KeyValueStore = {
initialized: false,
context: "",
init: function(ctx, messageBus) {
initialized = true;
context = ctx;
this.initialized = true;
this.context = ctx;
},
abandonLocal: function() {
var i, k;
if (!(localStorage && initialized)) {
if (!(localStorage && this.initialized)) {
return;
}
i = localStorage.length - 1;
while (i >= 0) {
k = localStorage.key(i);
if (k.substring(0, context.length) === context) {
if (k.substring(0, this.context.length) === this.context) {
localStorage.removeItem(k);
}
i--;
@ -31,21 +31,21 @@ Discourse.KeyValueStore = {
},
remove: function(key) {
return localStorage.removeItem(context + key);
return localStorage.removeItem(this.context + key);
},
set: function(opts) {
if (!(localStorage && initialized)) {
if (!(localStorage && this.initialized)) {
return false;
}
localStorage[context + opts.key] = opts.value;
localStorage[this.context + opts.key] = opts.value;
},
get: function(key) {
if (!localStorage) {
return null;
}
return localStorage[context + key];
return localStorage[this.context + key];
}
}

View File

@ -19,7 +19,7 @@ Discourse.ModalBodyView = Discourse.View.extend({
// Pass the errors to our errors view
displayErrors: function(errors, callback) {
this.set('parentView.parentView.modalErrorsView.errors', errors);
typeof callback === "function" ? callback() : void 0;
if (typeof callback === "function") callback();
},
// Just use jQuery to show an alert. We don't need anythign fancier for now