forked from mgcrea/angular-strap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopover.min.js
More file actions
9 lines (9 loc) · 2.04 KB
/
popover.min.js
File metadata and controls
9 lines (9 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
/**
* angular-strap
* @version v2.3.8 - 2016-03-31
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com> (https://github.com/mgcrea)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';angular.module('mgcrea.ngStrap.popover',['mgcrea.ngStrap.tooltip']).provider('$popover',function(){var t=this.defaults={animation:'am-fade',customClass:'',container:!1,target:!1,placement:'right',templateUrl:'popover/popover.tpl.html',contentTemplate:!1,trigger:'click',keyboard:!0,html:!1,title:'',content:'',delay:0,autoClose:!1};this.$get=['$tooltip',function(e){function n(n,a){var o=angular.extend({},t,a),r=e(n,o);return o.content&&(r.$scope.content=o.content),r}return n}]}).directive('bsPopover',['$window','$sce','$popover',function(t,e,n){var a=t.requestAnimationFrame||t.setTimeout;return{restrict:'EAC',scope:!0,link:function(t,o,r){var i,l={scope:t};angular.forEach(['template','templateUrl','controller','controllerAs','contentTemplate','placement','container','delay','trigger','html','animation','customClass','autoClose','id','prefixClass','prefixEvent'],function(t){angular.isDefined(r[t])&&(l[t]=r[t])});var c=/^(false|0|)$/i;angular.forEach(['html','container','autoClose'],function(t){angular.isDefined(r[t])&&c.test(r[t])&&(l[t]=!1)});var s=o.attr('data-target');angular.isDefined(s)&&(c.test(s)?l.target=!1:l.target=s),angular.forEach(['title','content'],function(n){r[n]&&r.$observe(n,function(o,r){t[n]=e.trustAsHtml(o),angular.isDefined(r)&&a(function(){i&&i.$applyPlacement()})})}),r.bsPopover&&t.$watch(r.bsPopover,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e,angular.isDefined(n)&&a(function(){i&&i.$applyPlacement()})},!0),r.bsShow&&t.$watch(r.bsShow,function(t,e){i&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(popover),?/i)),t===!0?i.show():i.hide())}),r.viewport&&t.$watch(r.viewport,function(t){i&&angular.isDefined(t)&&i.setViewport(t)}),i=n(o,l),t.$on('$destroy',function(){i&&i.destroy(),l=null,i=null})}}}]);
//# sourceMappingURL=popover.min.js.map