Your IP : 18.118.189.178


Current Path : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/www/bitrix/js/ui/textcrop/dist/
Upload File :
Current File : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/www/bitrix/js/ui/textcrop/dist/bundle.min.js

this.BX=this.BX||{};(function(t,e){"use strict";var i,r;var s=function(){function t(e){babelHelpers.classCallCheck(this,t);this.target=e.target||null;this.rows=e.rows||2;this.resize=e.resize||false;this.text=null;this.rowHeight=null;this.$wrapper=null;this.$basicBlock=null}babelHelpers.createClass(t,[{key:"getText",value:function t(){if(!this.text){this.text=this.target?this.target.innerText:null}return this.text}},{key:"getWrapper",value:function t(){if(!this.$wrapper){this.$wrapper=e.Tag.render(i||(i=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t<div>","</div>\n\t\t\t"])),this.getText())}return this.$wrapper}},{key:"getBasicBlock",value:function t(){if(!this.$basicBlock){this.$basicBlock=e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t<div>a</div>\n\t\t\t"])))}return this.$basicBlock}},{key:"getRowHeight",value:function t(){if(!this.rowHeight){var e=getComputedStyle(this.getWrapper());if(e.lineHeight==="normal"){var i=this.getWrapper().offsetHeight;this.$wrapper.appendChild(this.getBasicBlock());var r=this.getWrapper().offsetHeight;this.getBasicBlock().remove();this.rowHeight=r-i}else{this.rowHeight=e.lineHeight}}return this.rowHeight}},{key:"cropResize",value:function t(){if(this.resize){window.addEventListener("resize",BX.delegate(this.init,this))}}},{key:"crop",value:function t(){this.init()}},{key:"init",value:function t(){if(!e.Type.isDomNode(this.target)){return}this.getText();this.target.innerText="";this.$wrapper="";this.target.appendChild(this.getWrapper());var i=this.getRowHeight();var r="";var s=this.getWrapper().offsetHeight/parseInt(i);if(s>this.rows){this.target.setAttribute("title",this.getText());while(this.getWrapper().offsetHeight/parseInt(i)>this.rows){r=this.$wrapper.textContent.substring(0,this.$wrapper.textContent.length-4);this.$wrapper.innerHTML=r+"..."}}this.cropResize()}}]);return t}();t.TextCrop=s})(this.BX.UI=this.BX.UI||{},BX);
//# sourceMappingURL=bundle.map.js