-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathangular-bootstrap.min.js
11 lines (11 loc) · 2.63 KB
/
angular-bootstrap.min.js
1
2
3
4
5
6
7
8
9
10
11
/*
AngularJS v1.1.5-99cd86a
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
(function(n,i){'use strict';i.module("bootstrap",[]).directive({dropdownToggle:["$document","$location","$window",function(e,a){var d=null,b;return{restrict:"C",link:function(f,c){f.$watch(function(){return a.path()},function(){b&&b()});c.parent().bind("click",function(){b&&b()});c.bind("click",function(a){a.preventDefault();a.stopPropagation();a=!1;d&&(a=d===c,b());a||(c.parent().addClass("open"),d=c,b=function(a){a&&a.preventDefault();a&&a.stopPropagation();e.unbind("click",b);c.parent().removeClass("open");
d=b=null},e.bind("click",b))})}}}],syntax:function(){return{restrict:"A",link:function(e,a,d){var e='<nav class="syntax-links">',b={github:{text:"View on Github",key:"syntaxGithub",icon:"icon-github"},plunkr:{text:"View on Plunkr",key:"syntaxPlunkr",icon:"icon-arrow-down"},jsfiddle:{text:"View on JSFiddle",key:"syntaxFiddle",icon:"icon-cloud"}},f;for(f in b){var c=b[f],k=d[c.key];k&&(e+='<a href="'+k+'" class="btn syntax-'+f+'" target="_blank" rel="nofollow"><span class="'+c.icon+'"></span> '+c.text+
"</a>")}e+="</nav>";d=i.element(e);a=a[0];a.parentNode.insertBefore(d[0],a)}}},tabbable:function(){return{restrict:"C",compile:function(e){var a=i.element('<ul class="nav nav-tabs"></ul>'),d=i.element('<div class="tab-content"></div>');d.append(e.contents());e.append(a).append(d)},controller:["$scope","$element",function(e,a){var d=a.contents().eq(0),b=a.controller("ngModel")||{},f=[],c;b.$render=function(){var a=this.$viewValue;if(c?c.value!=a:a)if(c&&(c.paneElement.removeClass("active"),c.tabElement.removeClass("active"),
c=null),a){for(var b=0,d=f.length;b<d;b++)if(a==f[b].value){c=f[b];break}c&&(c.paneElement.addClass("active"),c.tabElement.addClass("active"))}};this.addPane=function(a,h){function l(){g.title=h.title;g.value=h.value||h.title;if(!b.$setViewValue&&(!b.$viewValue||g==c))b.$viewValue=g.value;b.$render()}var j=i.element("<li><a href></a></li>"),m=j.find("a"),g={paneElement:a,paneAttrs:h,tabElement:j};f.push(g);h.$observe("value",l)();h.$observe("title",function(){l();m.text(g.title)})();d.append(j);j.bind("click",
function(a){a.preventDefault();a.stopPropagation();b.$setViewValue?e.$apply(function(){b.$setViewValue(g.value);b.$render()}):(b.$viewValue=g.value,b.$render())});return function(){g.tabElement.remove();for(var a=0,b=f.length;a<b;a++)g==f[a]&&f.splice(a,1)}}}]}},table:function(){return{restrict:"E",link:function(e,a){a[0].className="table table-bordered table-striped code-table"}}},tabPane:function(){return{require:"^tabbable",restrict:"C",link:function(e,a,d,b){a.bind("$remove",b.addPane(a,d))}}}})})(window,
window.angular);