%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/js/report/js/visualconstructor/fields/
Upload File :
Create Path :
Current File : /home/bitrix/www/bitrix/js/report/js/visualconstructor/fields/reporthandlerselect.min.js

(function(){"use strict";BX.namespace("BX.Report.VisualConstructor.FieldEventHandlers");BX.Report.VisualConstructor.FieldEventHandlers.ReportHandlerSelect=function(e){BX.Report.VisualConstructor.Field.BaseHandler.apply(this,arguments)};BX.Report.VisualConstructor.FieldEventHandlers.ReportHandlerSelect.prototype={__proto__:BX.Report.VisualConstructor.Field.BaseHandler.prototype,constructor:BX.Report.VisualConstructor.FieldEventHandlers.ReportHandlerSelect,process:function(){switch(this.action){case"categorySelected":this.reloadReportHandlerList();break;case"reportHandlerSelected":this.reportHandlerSelected();break;case"removeReportFromConfiguration":this.removeReportFromConfiguration();break}},reportHandlerSelected:function(){var e=this.currentFieldObject.getForm();var t=e.querySelector("[data-role=reports-configurations-container]");var r=BX.findParent(this.currentFieldObject.fieldScope,{attr:{"data-role":"report-configuration-container"}});var o=r.getAttribute("data-source-report-handler");var a=t.getAttribute("data-widget-id");var i=r.getAttribute("data-report-id");var n=e.querySelector("[data-role=preview-view-type-key]");var l=r.getAttribute("data-is-pseudo");var s=this.currentFieldObject.getValue();if(o!==s){var d=this.getReportConfigurationColorPickerValue(r);BX.Report.VC.Core.ajaxPost("configuration.buildPseudoReportConfiguration",{data:{params:{widgetId:a,viewKey:n.value,reportHandlerClassName:s,colorFieldValue:d}},onFullSuccess:BX.delegate(function(t){var o=BX.create("div",{html:t.data});if(l==="1"){o.firstChild.setAttribute("data-source-report-handler",r.getAttribute("data-source-report-handler"));o.firstChild.setAttribute("data-source-report-id",r.getAttribute("data-source-report-id"));o.firstChild.classList.add("report-configuration-container-visible");r.parentNode.insertBefore(o.firstChild,r);BX.remove(r)}else{o.firstChild.setAttribute("data-source-report-id",i);o.firstChild.classList.add("report-configuration-container-visible");r.parentNode.insertBefore(o.firstChild,r);var a=BX.create("input",{props:{name:"deletedReports[]",type:"hidden",value:i},attrs:{"data-report-id":i}});e.appendChild(a);r.style.display="none";r.classList.remove("report-configuration-container-visible")}BX.html(null,t.data)},this)})}},getReportConfigurationColorPickerValue:function(e){var t=e.querySelector("[data-role=visualconstructor-fields-picker] > input");if(t){return t.value}else{return"#ffffff"}},reloadReportHandlerList:function(){BX.Report.VC.Core.ajaxGet("report.getReportHandlersByCategory",{urlParams:{categoryKey:this.ownerFieldObject.getValue()},onFullSuccess:BX.delegate(function(e){this.currentFieldObject.setOptions(e.data)},this)})},removeReportFromConfiguration:function(){var e=BX.findParent(this.currentField,{className:"report-configuration-container"});var t=e.getAttribute("data-report-id");var r=BX.create("input",{props:{name:"deletedReports[]",type:"hidden",value:t}});BX.remove(e);this.currentFieldObject.getForm().appendChild(r)}}})();

Zerion Mini Shell 1.0