public_html/layouts/basic/modules/Users/resources/SwitchUsers.min.js.map
{"version":3,"file":"SwitchUsers.min.js","sources":["SwitchUsers.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\njQuery.Class(\n\t'Vtiger_SwitchUsers_Js',\n\t{},\n\t{\n\t\t/**\n\t\t * Modal container\n\t\t */\n\t\tcontainer: false,\n\t\t/**\n\t\t * Register change user\n\t\t */\n\t\tregisterChangeUser: function () {\n\t\t\tthis.container.find('.js-switch-user').on('change', (e) => {\n\t\t\t\tlet showElement = $(e.currentTarget).find('option:selected').data('admin');\n\t\t\t\tlet subContainer = this.container.find('.js-sub-container');\n\t\t\t\tif (showElement) {\n\t\t\t\t\tsubContainer.removeClass('d-none');\n\t\t\t\t} else {\n\t\t\t\t\tsubContainer.addClass('d-none');\n\t\t\t\t}\n\t\t\t\tsubContainer.find('.js-text-element').attr('disabled', !showElement);\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register save\n\t\t */\n\t\tregisterSave: function () {\n\t\t\tlet form = this.container.find('form');\n\t\t\tthis.container.find('.js-switch-btn').on('click', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (form.validationEngine('validate')) {\n\t\t\t\t\tdocument.progressLoader = jQuery.progressIndicator({\n\t\t\t\t\t\tmessage: app.vtranslate('JS_LOADING_PLEASE_WAIT'),\n\t\t\t\t\t\tposition: 'html',\n\t\t\t\t\t\tblockInfo: {\n\t\t\t\t\t\t\tenabled: true\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tvar userId = form.find('[name=\"user\"]').val();\n\t\t\t\t\tform.find('[name=\"id\"]').val(userId);\n\t\t\t\t\tform.submit();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.container.find('.js-switch-to-yourself').on('click', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tdocument.progressLoader = jQuery.progressIndicator({\n\t\t\t\t\tmessage: app.vtranslate('JS_LOADING_PLEASE_WAIT'),\n\t\t\t\t\tposition: 'html',\n\t\t\t\t\tblockInfo: {\n\t\t\t\t\t\tenabled: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.container.find('.js-text-element').attr('disabled', true);\n\t\t\t\tform.submit();\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register Events\n\t\t */\n\t\tregisterEvents: function () {\n\t\t\tthis.container = jQuery('.switchUsersContainer');\n\t\t\tthis.registerSave();\n\t\t\tthis.registerChangeUser();\n\t\t}\n\t}\n);\n\njQuery(document).ready(function (e) {\n\tvar instance = new Vtiger_SwitchUsers_Js();\n\tinstance.registerEvents();\n});\n"],"names":["jQuery","Class","container","registerChangeUser","_this","find","on","e","showElement","$","currentTarget","data","subContainer","removeClass","addClass","attr","registerSave","_this2","form","preventDefault","validationEngine","document","progressLoader","progressIndicator","message","app","vtranslate","position","blockInfo","enabled","userId","val","submit","registerEvents","ready","instance","Vtiger_SwitchUsers_Js"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,MAAM,CAACC,KAAK,CACX,uBAAuB,CACvB,EAAE,CACF;AAED;AACA,KACEC,SAAS,GAAO;AAElB;AACA,KACEC,kBAAkB,CAAE,SAAAA,oBAAY,CAAA,IAAAC,KAAA,CAC/B,IAAA,CAAA,IAAI,CAACF,SAAS,CAACG,IAAI,CAAC,iBAAiB,CAAC,CAACC,EAAE,CAAC,QAAQ,CAAE,SAACC,CAAC,CAAK,CACtD,IAAAC,WAAW,CAAGC,CAAC,CAACF,CAAC,CAACG,aAAa,CAAC,CAACL,IAAI,CAAC,iBAAiB,CAAC,CAACM,IAAI,CAAC,OAAO,CAAC,CACtEC,YAAY,CAAGR,KAAI,CAACF,SAAS,CAACG,IAAI,CAAC,mBAAmB,CAAC,CACvDG,WAAW,CACdI,YAAY,CAACC,WAAW,CAAC,QAAQ,CAAC,CAElCD,YAAY,CAACE,QAAQ,CAAC,QAAQ,CAAC,CAEhCF,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