Sha256: 7fa3412a633606dfec4ab38f98948106d2fa58f2021ea58ded0bec4c82338cce

Contents?: true

Size: 1.16 KB

Versions: 309

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

309 entries across 309 versions & 6 rubygems

Version Path
rbbt-rest-1.8.136 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.135 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.134 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.133 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.132 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.131 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.130 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.129 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.126 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.123 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.122 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.121 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.120 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.119 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.118 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.117 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.116 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.115 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.114 share/views/public/js/foundation/foundation.alerts.js
rbbt-rest-1.8.113 share/views/public/js/foundation/foundation.alerts.js