YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
Test Coverage
{"version":3,"file":"Tools.min.js","sources":["Tools.js"],"sourcesContent":["/* {[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]} */\n'use strict';\n\nApp.Tools = {\n\tVariablesPanel: {\n\t\t/**\n\t\t * Generate values based on selected company\n\t\t * @param container\n\t\t */\n\t\trefreshCompanyVariables(container) {\n\t\t\tconst companyId = container.find('.js-company-list').val();\n\t\t\tcontainer.find('.js-company-variable > optgroup > option').each(function () {\n\t\t\t\tlet template = $(this).data('value-template');\n\t\t\t\tthis.value = template.replace(/__X__/i, companyId);\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register change company event\n\t\t * @param container\n\t\t */\n\t\tregisterRefreshCompanyVariables(container) {\n\t\t\tcontainer.find('.js-company-list').on('change', function (e) {\n\t\t\t\tApp.Tools.VariablesPanel.refreshCompanyVariables(container);\n\t\t\t});\n\t\t}\n\t},\n\tForm: {\n\t\t/**\n\t\t * Generate values based on selected company\n\t\t * @param {jQuery} container\n\t\t */\n\t\tregisterBlockToggle(container) {\n\t\t\tcontainer.on('click', '.js-toggle-block', function (e) {\n\t\t\t\tconst target = $(e.target);\n\t\t\t\tif (\n\t\t\t\t\ttarget.is('input') ||\n\t\t\t\t\ttarget.is('button') ||\n\t\t\t\t\ttarget.parents().is('button') ||\n\t\t\t\t\ttarget.hasClass('js-stop-propagation') ||\n\t\t\t\t\ttarget.parents().hasClass('js-stop-propagation')\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst blockHeader = $(e.currentTarget);\n\t\t\t\tconst blockContents = blockHeader.next();\n\t\t\t\tconst icon = blockHeader.find('.js-toggle-icon');\n\t\t\t\tif (blockContents.hasClass('d-none')) {\n\t\t\t\t\tblockContents.removeClass('d-none');\n\t\t\t\t\ticon.removeClass(icon.data('hide')).addClass(icon.data('show'));\n\t\t\t\t} else {\n\t\t\t\t\tblockContents.addClass('d-none');\n\t\t\t\t\ticon.removeClass(icon.data('show')).addClass(icon.data('hide'));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n};\n"],"names":["App","Tools","VariablesPanel","refreshCompanyVariables","container","companyId","find","val","each","template","$","data","value","replace","registerRefreshCompanyVariables","on","Form","registerBlockToggle","e","target","is","parents","hasClass","blockHeader","currentTarget","blockContents","next","icon","removeClass","addClass"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,GAAG,CAACC,KAAK,CAAG,CACXC,cAAc,CAAE;AAEjB;AACA;AACA,KACEC,uBAAuB,CAAA,SAAAA,uBAACC,CAAAA,SAAS,CAAE,CAClC,IAAMC,SAAS,CAAGD,SAAS,CAACE,IAAI,CAAC,kBAAkB,CAAC,CAACC,GAAG,EAAE,CAC1DH,SAAS,CAACE,IAAI,CAAC,0CAA0C,CAAC,CAACE,IAAI,CAAC,UAAY,CAC3E,IAAIC,QAAQ,CAAGC,CAAC,CAAC,IAAI,CAAC,CAACC,IAAI,CAAC,gBAAgB,CAAC,CAC7C,IAAI,CAACC,KAAK,CAAGH,QAAQ,CAACI,OAAO,CAAC,QAAQ,CAAER,SAAS,EAClD,CAAC,EACF,CAAC;AAEH;AACA;AACA,KACES,+BAA+B,CAAAA,SAAAA,+BAAAA,CAACV,SAAS,CAAE,CAC1CA,SAAS,CAACE,IAAI,CAAC,kBAAkB,CAAC,CAACS,EAAE,CAAC,QAAQ,CAAE,UAAa,CAC5Df,GAAG,CAACC,KAAK,CAACC,cAAc,CAACC,uBAAuB,CAACC,SAAS,EAC3D,CAAC,EACF,CACD,CAAC,CACDY,IAAI,CAAE;AAEP;AACA;AACA,KACEC,mBAAmB,CAAAA,SAAAA,mBAAAA,CAACb,SAAS,CAAE,CAC9BA,SAAS,CAACW,EAAE,CAAC,OAAO,CAAE,kBAAkB,CAAE,SAAUG,CAAC,CAAE,CACtD,IAAMC,MAAM,CAAGT,CAA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