mirror of
https://github.com/AlekseyLobanov/AlekseyLobanov.github.io.git
synced 2026-01-12 13:12:03 +03:00
First commut
This commit is contained in:
34
theme/js/foundation/foundation.alert.js
vendored
Normal file
34
theme/js/foundation/foundation.alert.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
;(function ($, window, document, undefined) {
|
||||
'use strict';
|
||||
|
||||
Foundation.libs.alert = {
|
||||
name : 'alert',
|
||||
|
||||
version : '5.0.0',
|
||||
|
||||
settings : {
|
||||
animation: 'fadeOut',
|
||||
speed: 300, // fade out speed
|
||||
callback: function (){}
|
||||
},
|
||||
|
||||
init : function (scope, method, options) {
|
||||
this.bindings(method, options);
|
||||
},
|
||||
|
||||
events : function () {
|
||||
$(this.scope).off('.alert').on('click.fndtn.alert', '[data-alert] a.close', function (e) {
|
||||
var alertBox = $(this).closest("[data-alert]"),
|
||||
settings = alertBox.data('alert-init');
|
||||
|
||||
e.preventDefault();
|
||||
alertBox[settings.animation](settings.speed, function () {
|
||||
$(this).trigger('closed').remove();
|
||||
settings.callback();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reflow : function () {}
|
||||
};
|
||||
}(jQuery, this, this.document));
|
||||
Reference in New Issue
Block a user