bs-alert.min.js 2.4 KB

1
  1. +function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),function(){Bootstrap.BsAlertComponent=Ember.Component.extend(Bootstrap.TypeSupport,{classNames:["alert"],classNameBindings:["fade","fade:in"],layoutName:"components/bs-alert",classTypePrefix:"alert",attributeBindings:["data-timeout"],dismissAfter:0,didInsertElement:function(){var a=this;return this.dismissAfter>0&&Ember.run.later(this,"dismiss",1e3*this.dismissAfter),Ember.$("#"+this.elementId).bind("closed.bs.alert",function(){return a.sendAction("closed"),a.destroy()}),Ember.$("#"+this.elementId).bind("close.bs.alert",function(){return a.sendAction("close")})},dismiss:function(){return Ember.$("#"+this.elementId).alert("close")}}),Ember.Handlebars.helper("bs-alert",Bootstrap.BsAlertComponent)}.call(this),this.Ember=this.Ember||{},this.Ember.TEMPLATES=this.Ember.TEMPLATES||{},this.Ember.TEMPLATES["components/bs-alert"]=Ember.Handlebars.template(function(a,b,c,d,e){function f(a,b){b.buffer.push('\n <a class="close" data-dismiss="alert" href="#">&times;</a>\n')}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,Ember.Handlebars.helpers),e=e||{};var g,h,i,j="",k=this,l=this.escapeExpression;return h={},i={},g=c["if"].call(b,"dismiss",{hash:{},inverse:k.noop,fn:k.program(1,f,e),contexts:[b],types:["ID"],hashContexts:i,hashTypes:h,data:e}),(g||0===g)&&e.buffer.push(g),e.buffer.push("\n"),h={},i={},e.buffer.push(l(c._triageMustache.call(b,"message",{hash:{},contexts:[b],types:["ID"],hashContexts:i,hashTypes:h,data:e}))),h={},i={},e.buffer.push(l(c._triageMustache.call(b,"yield",{hash:{},contexts:[b],types:["ID"],hashContexts:i,hashTypes:h,data:e}))),j});