Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['mb/core', 'jQuery', 'handlebars', 'responsive/lib/jquery.cookie'], factory);
} else {
// Browser globals (root is window)
root.returnExports = factory(root.mb, root.jQuery, root.Handlebars);
}
}(this,
function(mb, $, Handlebars) {
//firstly make sure the namespace exists:
var log = mb.logger,
cookiesNs = mb.nameSpace('utils','cookies');
function setEmailCookie(){
$.cookie('MBUSA_ESM_STATUS','1',{ path: '/', expires:new Date( 2042, 1, 1 ) });
};
function removeEmailCookie(){
$.removeCookie('MBUSA_ESM_STATUS', { path: '/' });
};
cookiesNs = {
setEmailCookie : setEmailCookie,
removeEmailCookie : removeEmailCookie
};
return cookiesNs;
}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment