aboutsummaryrefslogtreecommitdiffstats
path: root/zurb-F5-basic/static/js/foundation/foundation.alert.js
diff options
context:
space:
mode:
authorShuaib Hanief <shuaib@hanief.net>2013-12-31 22:54:56 -0500
committerShuaib Hanief <shuaib@hanief.net>2013-12-31 22:54:56 -0500
commit49f5657d936e352112fdcfa61473f5f38cda1c14 (patch)
tree75f480ed27af49c8dd1149344b967b5676d2460e /zurb-F5-basic/static/js/foundation/foundation.alert.js
parenteada362fff3da25eae0ca9283ac5fcb2f65e2e6a (diff)
downloadpelican-themes-49f5657d936e352112fdcfa61473f5f38cda1c14.tar.gz
add a theme based on the new Zurb Foundation 5 framework
Diffstat (limited to 'zurb-F5-basic/static/js/foundation/foundation.alert.js')
-rw-r--r--zurb-F5-basic/static/js/foundation/foundation.alert.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/zurb-F5-basic/static/js/foundation/foundation.alert.js b/zurb-F5-basic/static/js/foundation/foundation.alert.js
new file mode 100644
index 0000000..1bb404a
--- /dev/null
+++ b/zurb-F5-basic/static/js/foundation/foundation.alert.js
@@ -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));