gitlab-com-adeattwood-bs-ad.../dist/a-alert.min.js
2017-11-17 05:31:12 +00:00

1 line
No EOL
1.2 KiB
JavaScript

"use strict";!function(t){t.fn.aalert=function(s){return e[s]?e[s].apply(this,Array.prototype.slice.call(arguments,1)):(t.error("Method "+s+" does not exist"),!1)};var e={changeTo:function(e){var s=t(this);return s.removeClass(function(t,e){return(e.match(/(^|\s)alert-\S+/g)||[]).join(" ")}),s.addClass("alert-"+e),this},changeContentTo:function(s){var a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t(this).find(".alert-content").html(s),!0===a&&e.open.apply(this),this},toggle:function(){var e=t(this);return e.hasClass("fade")?e.fadeToggle():e.hasClass("slide")?e.slideToggle():e.toggle(),this},close:function(){var e=t(this);return e.hasClass("fade")?e.fadeOut():e.hasClass("slide")?e.slideUp():e.hide(),e.hasClass("remove")&&e.remove(),this},open:function(){var e=t(this);return e.hasClass("fade")?e.fadeIn():e.hasClass("slide")?e.slideDown():e.show(),this},closeAfter:function(t){var s=this;return setTimeout(function(){e.close.apply(s)},t),this}};t('.alert [data-dismiss="aalert"]').click(function(s){var a=t(s.target).closest(".alert");e.close.apply(a)}),t(".alert[data-timeout]").each(function(s,a){e.closeAfter.apply(a,[t(a).data("timeout")])})}(jQuery);