popover.min.js 2.2 KB

12345678910
  1. /**
  2. * angular-strap
  3. * @version v2.3.9 - 2016-06-10
  4. * @link http://mgcrea.github.io/angular-strap
  5. * @author Olivier Louvignes <olivier@mg-crea.com> (https://github.com/mgcrea)
  6. * @license MIT License, http://www.opensource.org/licenses/MIT
  7. */
  8. '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)}),angular.forEach(['onBeforeShow','onShow','onBeforeHide','onHide'],function(e){var n='bs'+e.charAt(0).toUpperCase()+e.slice(1);angular.isDefined(r[n])&&(l[e]=t.$eval(r[n]))});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})}}}]);
  9. //# sourceMappingURL=popover.min.js.map