Skip to content

Commit

Permalink
Build source
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsednaoui committed May 13, 2014
1 parent e2d28c3 commit 24060f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions build/ouibounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ return function ouibounce(el, config) {
timer = setDefault(config.timer, 1000),
callback = config.callback || function() {},
cookieExpire = setDefaultCookieExpire(config.cookieExpire) || '',
sitewide = config.sitewide === true ? ';path=/' : '',
_html = document.getElementsByTagName('html')[0];

function setDefault(_property, _default) {
Expand Down Expand Up @@ -81,12 +82,17 @@ return function ouibounce(el, config) {
var options = options || {};

// you can pass a specific cookie expiration when using the OuiBounce API
// ex: _ouiBounce.disable({ cookieExpire: 5, sitewide: true });
// ex: _ouiBounce.disable({ cookieExpire: 5 });
if (typeof options.cookieExpire !== 'undefined') {
cookieExpire = setDefaultCookieExpire(options.cookieExpire);
}

var sitewide = (options.sitewide === true) ? ';path=/' : '';
// you can pass use sitewide cookies too
// ex: _ouiBounce.disable({ cookieExpire: 5, sitewide: true });
if (typeof options.sitewide !== 'undefined') {
sitewide = ';path=/';
}

document.cookie = 'viewedOuibounceModal=true' + cookieExpire + sitewide;

// remove listeners
Expand Down
2 changes: 1 addition & 1 deletion build/ouibounce.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24060f2

Please sign in to comment.