YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/resources/Tools.min.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */"use strict";App.Tools={VariablesPanel:{/**
         * Generate values based on selected company
         * @param container
         */refreshCompanyVariables:function refreshCompanyVariables(container){var companyId=container.find(".js-company-list").val();container.find(".js-company-variable > optgroup > option").each(function(){var template=$(this).data("value-template");this.value=template.replace(/__X__/i,companyId);});},/**
         * Register change company event
         * @param container
         */registerRefreshCompanyVariables:function registerRefreshCompanyVariables(container){container.find(".js-company-list").on("change",function(){App.Tools.VariablesPanel.refreshCompanyVariables(container);});}},Form:{/**
         * Generate values based on selected company
         * @param {jQuery} container
         */registerBlockToggle:function registerBlockToggle(container){container.on("click",".js-toggle-block",function(e){var target=$(e.target);if(target.is("input")||target.is("button")||target.parents().is("button")||target.hasClass("js-stop-propagation")||target.parents().hasClass("js-stop-propagation"))return !1;var blockHeader=$(e.currentTarget),blockContents=blockHeader.next(),icon=blockHeader.find(".js-toggle-icon");blockContents.hasClass("d-none")?(blockContents.removeClass("d-none"),icon.removeClass(icon.data("hide")).addClass(icon.data("show"))):(blockContents.addClass("d-none"),icon.removeClass(icon.data("show")).addClass(icon.data("hide")));});}}};
//# sourceMappingURL=Tools.min.js.map