@owstack/ows-wallet-applet-coinbase
Version:
An OWS Wallet applet plugin for Coinbase.
1 lines • 1.63 kB
JavaScript
!function(t,e,i,n){"use strict";i.module("ngFitText",[]).value("fitTextDefaultConfig",{debounce:!1,delay:250,loadDelay:10,compressor:1,min:0,max:Number.POSITIVE_INFINITY}).directive("fittext",["$timeout","fitTextDefaultConfig","fitTextConfig",function(e,n,o){return{restrict:"A",scope:!0,link:function(f,a,l){function r(){var t=z*m/h.offsetWidth/m;return Math.max(Math.min((s[0].offsetWidth-(parseFloat(getComputedStyle(s[0]).paddingLeft)+parseFloat(getComputedStyle(s[0]).paddingRight))-6)*t*y,parseFloat(C)),parseFloat(b))}function u(){h.offsetHeight*h.offsetWidth!==0&&(g.fontSize=z+"px",g.lineHeight="1",g.display="inline-block",g.fontSize=r()+"px",g.lineHeight=T,g.display=W)}function c(){d&&e.cancel(d),d=e(function(){d=null,u()},5)}i.extend(n,o.config);var d,s=a.parent(),h=a[0],g=h.style,p=t.getComputedStyle(a[0],null),m=a.children().length||1,x=l.fittextLoadDelay||n.loadDelay,y=isNaN(parseInt(l.fittext))?n.compressor:l.fittext,v=l.fittextMin||n.min,$=l.fittextMax||n.max,b="inherit"===v?p["font-size"]:v,C="inherit"===$?p["font-size"]:$,T=p["line-height"],W=p.display,z=10;e(function(){c()},x),f.$watch(function(){return[f.$eval(l.ngBind),s[0].offsetWidth,a[0].offsetWidth].join("_")},function(){c()}),f.$watch(function(){return[f.$eval(l.ngBindHtml),s[0].offsetWidth,a[0].offsetWidth].join("_")},function(){c()}),n.debounce?i.element(t).bind("resize",n.debounce(function(){f.$apply(c)},n.delay)):i.element(t).bind("resize",function(){f.$apply(c)})}}}]).provider("fitTextConfig",function(){var t=this;return this.config={},this.$get=function(){var e={};return e.config=t.config,e},this})}(window,document,angular);