Add footer about last updated time
[web.git] / js / foundation / foundation.alert.js
1 ;
2 (function ($, window, document, undefined) {
3 'use strict';
4
5 Foundation.libs.alert = {
6 name: 'alert',
7
8 version: '5.5.0',
9
10 settings: {
11 callback: function () {
12 }
13 },
14
15 init: function (scope, method, options) {
16 this.bindings(method, options);
17 },
18
19 events: function () {
20 var self = this,
21 S = this.S;
22
23 $(this.scope).off('.alert').on('click.fndtn.alert', '[' + this.attr_name() + '] .close', function (e) {
24 var alertBox = S(this).closest('[' + self.attr_name() + ']'),
25 settings = alertBox.data(self.attr_name(true) + '-init') || self.settings;
26
27 e.preventDefault();
28 if (Modernizr.csstransitions) {
29 alertBox.addClass('alert-close');
30 alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) {
31 S(this).trigger('close').trigger('close.fndtn.alert').remove();
32 settings.callback();
33 });
34 } else {
35 alertBox.fadeOut(300, function () {
36 S(this).trigger('close').trigger('close.fndtn.alert').remove();
37 settings.callback();
38 });
39 }
40 });
41 },
42
43 reflow: function () {
44 }
45 };
46 }(jQuery, window, window.document));