Sha256: ebb1ea7181095ab808a5f1080c58c8b1ec13a84fcb965ab6a84bc5bd1441fa32

Contents?: true

Size: 1.36 KB

Versions: 24

Compression:

Stored size: 1.36 KB

Contents

/*jslint unparam: true, browser: true, indent: 2 */

;(function ($, window, document, undefined) {
  'use strict';

  Foundation.libs.alerts = {
    name : 'alerts',

    version : '4.3.2',

    settings : {
      animation: 'fadeOut',
      speed: 300, // fade out speed
      callback: function (){}
    },

    init : function (scope, method, options) {
      this.scope = scope || this.scope;
      Foundation.inherit(this, 'data_options');

      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) {
          var alertBox = $(this).closest("[data-alert]"),
              settings = $.extend({}, self.settings, self.data_options(alertBox));

        e.preventDefault();
        alertBox[settings.animation](settings.speed, function () {
          $(this).remove();
          settings.callback();
        });
      });

      this.settings.init = true;
    },

    off : function () {
      $(this.scope).off('.fndtn.alerts');
    },

    reflow : function () {}
  };
}(Foundation.zj, this, this.document));

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
locomotivecms_wagon-2.0.0.rc3 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.rc2 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.rc1 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.beta.2 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.8 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.beta.1 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.7 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.6 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.alpha.3 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.alpha.2 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.alpha.1 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-2.0.0.pre.alpha generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.5 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.4 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.3 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.2 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.1 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.0 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.5.0.rc1 generators/line_case/public/javascripts/foundation/foundation.alerts.js
locomotivecms_wagon-1.4.0 generators/foundation/public/javascripts/foundation/foundation.alerts.js