mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Kill malfunctioning shim for localStorage in IE 7
jQuery removed $.browser, so this code threw an exception any time localStorage wasn't available. Moreover, IE 8 supports localStorage (as far as I'm aware), and we don't care about having something fancy just for IE 7.
This commit is contained in:
@@ -29,36 +29,6 @@ if (window.localStorage) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX eliminate dependency on jQuery, detect browsers ourselves
|
|
||||||
// Else, if we are on IE, which support userData
|
|
||||||
if (!Meteor._localStorage && $.browser.msie) {
|
|
||||||
var userdata = document.createElement('span'); // could be anything
|
|
||||||
userdata.style.behavior = 'url("#default#userData")';
|
|
||||||
userdata.id = 'localstorage-helper';
|
|
||||||
userdata.style.display = 'none';
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(userdata);
|
|
||||||
|
|
||||||
var userdataKey = 'localStorage';
|
|
||||||
userdata.load(userdataKey);
|
|
||||||
|
|
||||||
Meteor._localStorage = {
|
|
||||||
setItem: function (key, val) {
|
|
||||||
userdata.setAttribute(key, val);
|
|
||||||
userdata.save(userdataKey);
|
|
||||||
},
|
|
||||||
|
|
||||||
removeItem: function (key) {
|
|
||||||
userdata.removeAttribute(key);
|
|
||||||
userdata.save(userdataKey);
|
|
||||||
},
|
|
||||||
|
|
||||||
getItem: function (key) {
|
|
||||||
userdata.load(userdataKey);
|
|
||||||
return userdata.getAttribute(key);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Meteor._localStorage) {
|
if (!Meteor._localStorage) {
|
||||||
Meteor._debug(
|
Meteor._debug(
|
||||||
"You are running a browser with no localStorage or userData "
|
"You are running a browser with no localStorage or userData "
|
||||||
|
|||||||
Reference in New Issue
Block a user