Skip to content

Commit

Permalink
a bug fixed in removing localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsandotnet committed Jul 23, 2013
1 parent f81c672 commit 841cd26
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions widearea.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
//save textarea data in localStorage
var storage = 'WDATA-' + this.getAttribute('data-widearea-id');
localStorage.setItem(storage,this.value);
console.log(storage + '=' + this.value);
};

//to hold all textareas in the page
Expand Down Expand Up @@ -397,10 +396,6 @@
}
};

var clearData = function(element) {
localStorage.remove('WDATA-' + element.getAttribute('data-widearea-id'));
}

/**
* Current WideArea version
*
Expand All @@ -421,10 +416,13 @@
setOptions: function(options) {
this._options = _mergeOptions(this._options, options);
return this;
},
clearData: function(id){
localStorage.removeItem('WDATA-' + id);
return this;
}
};

exports.wideArea = wideArea;
exports.clearData = clearData;
return wideArea;
}));

0 comments on commit 841cd26

Please sign in to comment.