Sha256: f9495c907733b23778fa8bba2a498f9d26372c71f9cb83b598cd5d12988d9663

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

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

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

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

    version : '4.2.2',

    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');
    },

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
moovui-0.1.4 app/assets/javascripts/foundation.alerts.js
moovui-0.1.3 app/assets/javascripts/foundation.alerts.js
moovui-0.1.2 app/assets/javascripts/foundation.alerts.js
moovui-0.1.1 app/assets/javascripts/foundation.alerts.js
moovui-0.0.2 foundation.alerts.js
moovui-0.0.1 foundation.alerts.js