Current Path : /var/www/u0635749/data/www/hobbyclick.ru/public/www/bitrix/js/report/js/dashboard/ |
Current File : /var/www/u0635749/data/www/hobbyclick.ru/public/www/bitrix/js/report/js/dashboard/content.min.js |
(function(){"use strict";BX.namespace("BX.Report.Dashboard");BX.Report.Dashboard.Content=function(t){this.height=t.height||"auto";this.color=t.color||"inherit";this.previewImageUri=t.previewImageUri||"";this.errors=t.errors||[];this.data=t.data||{};this.rendered=false;this.widget=t.widget||null;this.layout={container:null,previewContainer:null}};BX.Report.Dashboard.Content.prototype={isRendered:function(){return this.rendered},setRenderStatus:function(t){this.rendered=t},getColor:function(){return this.color},getHeight:function(){if(this.height!=="auto"){return this.height-55}else{return"auto"}},setWidget:function(t){this.widget=t;return this},getWidget:function(){return this.widget},render:function(){return BX.create("div",{html:"parent render"})},renderPreview:function(){if(this.layout.previewContainer){return this.layout.previewContainer}if(this.previewImageUri){this.layout.previewContainer=BX.create("img",{attrs:{src:this.previewImageUri,height:"390px",width:"100%"}})}return this.layout.previewContainer}};BX.Report.Dashboard.Content.Html=function(t){this.html=t.html||[];this.js=t.js||[];this.css=t.css||"";this.config=t.config||"";this.htmlContentWrapper=BX.create("div");BX.Report.Dashboard.Content.apply(this,arguments)};BX.Report.Dashboard.Content.Html.counter=0;BX.Report.Dashboard.Content.Html.callbacks={};BX.Report.Dashboard.Content.Html.ready=function(t){this.callbacks[this.counter]=t};BX.Report.Dashboard.Content.Html.callCallbackInContext=function(t,e){if(this.callbacks[t]){this.callbacks[t](e)}};BX.Report.Dashboard.Content.Html.prototype={__proto__:BX.Report.Dashboard.Content.prototype,constructor:BX.Report.Dashboard.Content.Html,loadAssets:function(){var t=this.js.length?this.js:[];var e=this.css.length?this.css:[];var r=t.concat(e);if(r.length){BX.load(r,this.fillHtmlContentWrapper.bind(this))}else{this.fillHtmlContentWrapper()}},fillHtmlContentWrapper:function(){BX.Report.Dashboard.Content.Html.counter++;var t=BX.processHTML(this.html);this.htmlContentWrapper.innerHTML=t.HTML;BX.ajax.processScripts(t.SCRIPT,false,function(){BX.Report.Dashboard.Content.Html.callCallbackInContext(BX.Report.Dashboard.Content.Html.counter,this.htmlContentWrapper)}.bind(this));this.htmlContentWrapper.style.minHeight=this.getHeight()+"px";this.htmlContentWrapper.style.overflow="hidden"},render:function(){if(this.isRendered()){return this.htmlContentWrapper}else{BX.addCustomEvent(this.widget,"Dashboard.Board.Widget:onAfterRender",function(){if(this.htmlContentWrapper.parentNode){this.loadAssets()}}.bind(this));this.setRenderStatus(true);return this.htmlContentWrapper}},setHeight:function(t){this.height=t;this.htmlContentWrapper.style.minHeight=this.height+"px"}};BX.Report.Dashboard.Content.Empty=function(t){BX.Report.Dashboard.Content.apply(this,arguments)};BX.Report.Dashboard.Content.Empty.prototype={__proto__:BX.Report.Dashboard.Content.prototype,constructor:BX.Report.Dashboard.Content.Empty,render:function(){return BX.create("div",{styles:{height:this.getHeight()+"px"},html:"empty content"})}};BX.Report.Dashboard.Content.Error=function(t){BX.Report.Dashboard.Content.apply(this,arguments)};BX.Report.Dashboard.Content.Error.prototype={__proto__:BX.Report.Dashboard.Content.prototype,constructor:BX.Report.Dashboard.Content.Error,render:function(){var t=[];for(var e=0;e<this.errors.length;e++){t.push(BX.create("div",{html:this.errors[e],style:{color:"red"}}))}return BX.create("div",{styles:{height:this.getHeight()+"px"},children:t})}}})(); //# sourceMappingURL=content.map.js