1
0
mirror of https://github.com/arsenetar/pelican-red.git synced 2024-11-22 19:29:02 +00:00
pelican-red/static/js/vendor/foundation.alerts.js
Andrew Senetar af956c82be Add vendor JavaScript
Adds the vendor javascript for foundation 4, zepto.js, jquery, and
modernizer.  foundation scripts to be compressed after finalized.
2013-05-27 21:10:05 -04:00

50 lines
1.1 KiB
JavaScript

/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.alerts = {
name : 'alerts',
version : '4.0.0',
settings : {
speed: 300, // fade out speed
callback: function (){}
},
init : function (scope, method, options) {
this.scope = scope || this.scope;
if (typeof method === 'object') {
$.extend(true, this.settings, method);
}
if (typeof method != 'string') {
if (!this.settings.init) this.events();
return this.settings.init;
} else {
return this[method].call(this, options);
}
},
events : function () {
var self = this;
$(this.scope).on('click.fndtn.alerts', '[data-alert] a.close', function (e) {
e.preventDefault();
$(this).closest("[data-alert]").fadeOut(self.speed, function () {
$(this).remove();
self.settings.callback();
});
});
this.settings.init = true;
},
off : function () {
$(this.scope).off('.fndtn.alerts');
}
};
}(Foundation.zj, this, this.document));