mirror of
https://github.com/wahyd4/cdnjs.git
synced 2026-08-26 05:05:59 +10:00
Sources: http://code.angularjs.org/* Added missing versions, fixed some files reporting as min’d but weren’t, the sneaky varmints. Addresses https://github.com/cdnjs/cdnjs/issues/1188 - I think. Can be closed if it does.
1 line
1.9 KiB
JavaScript
1 line
1.9 KiB
JavaScript
(function(b,a,d){var c={};c.dropdownToggle=["$document","$location","$window",function(h,i,g){var e=null,f;return{restrict:"C",link:function(m,l,k){m.$watch(function n(){return i.path()},function j(){f&&f()});l.parent().bind("click",function(o){f&&f()});l.bind("click",function(o){o.preventDefault();o.stopPropagation();var p=false;if(e){p=e===l;f()}if(!p){l.parent().addClass("open");e=l;f=function(q){q&&q.preventDefault();q&&q.stopPropagation();h.unbind("click",f);l.parent().removeClass("open");f=null;e=null};h.bind("click",f)}})}}}];c.tabbable=function(){return{restrict:"C",compile:function(f){var e=a.element('<ul class="nav nav-tabs"></ul>'),g=a.element('<div class="tab-content"></div>');g.append(f.contents());f.append(e).append(g)},controller:["$scope","$element",function(h,f){var e=f.contents().eq(0),j=f.controller("ngModel")||{},i=[],g;j.$render=function(){var k=this.$viewValue;if(g?(g.value!=k):k){if(g){g.paneElement.removeClass("active");g.tabElement.removeClass("active");g=null}if(k){for(var l=0,m=i.length;l<m;l++){if(k==i[l].value){g=i[l];break}}if(g){g.paneElement.addClass("active");g.tabElement.addClass("active")}}}};this.addPane=function(n,l){var k=a.element("<li><a href></a></li>"),m=k.find("a"),o={paneElement:n,paneAttrs:l,tabElement:k};i.push(o);l.$observe("value",p)();l.$observe("title",function(){p();m.text(o.title)})();function p(){o.title=l.title;o.value=l.value||l.title;if(!j.$setViewValue&&(!j.$viewValue||o==g)){j.$viewValue=o.value}j.$render()}e.append(k);k.bind("click",function(q){q.preventDefault();q.stopPropagation();if(j.$setViewValue){h.$apply(function(){j.$setViewValue(o.value);j.$render()})}else{j.$viewValue=o.value;j.$render()}});return function(){o.tabElement.remove();for(var q=0,r=i.length;q<r;q++){if(o==i[q]){i.splice(q,1)}}}}}]}};c.tabPane=function(){return{require:"^tabbable",restrict:"C",link:function(h,g,f,e){g.bind("$remove",e.addPane(g,f))}}};a.module("bootstrap",[]).directive(c)})(window,window.angular); |