vendor/assets/javascripts/jquery.cookie.js in h2ocube_rails_assets-0.0.25 vs vendor/assets/javascripts/jquery.cookie.js in h2ocube_rails_assets-0.0.26
- old
+ new
@@ -36,17 +36,12 @@
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
- s = decodeURIComponent(s.replace(pluses, ' '));
- } catch(e) {
- return;
- }
-
- try {
// If we can't parse the cookie, ignore it, it's unusable.
+ s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
@@ -104,14 +99,15 @@
};
config.defaults = {};
$.removeCookie = function (key, options) {
- if ($.cookie(key) !== undefined) {
- // Must not alter options, thus extending a fresh object...
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
- return true;
+ if ($.cookie(key) === undefined) {
+ return false;
}
- return false;
+
+ // Must not alter options, thus extending a fresh object...
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
+ return !$.cookie(key);
};
}));