YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Users/resources/SwitchUsers.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";jQuery.Class("Vtiger_SwitchUsers_Js",{},{/**
         * Modal container
         */container:!1,/**
         * Register change user
         */registerChangeUser:function registerChangeUser(){var _this=this;this.container.find(".js-switch-user").on("change",function(e){var showElement=$(e.currentTarget).find("option:selected").data("admin"),subContainer=_this.container.find(".js-sub-container");showElement?subContainer.removeClass("d-none"):subContainer.addClass("d-none"),subContainer.find(".js-text-element").attr("disabled",!showElement);});},/**
         * Register save
         */registerSave:function registerSave(){var _this2=this,form=this.container.find("form");this.container.find(".js-switch-btn").on("click",function(e){if(e.preventDefault(),form.validationEngine("validate")){document.progressLoader=jQuery.progressIndicator({message:app.vtranslate("JS_LOADING_PLEASE_WAIT"),position:"html",blockInfo:{enabled:!0}});var userId=form.find("[name=\"user\"]").val();form.find("[name=\"id\"]").val(userId),form.submit();}}),this.container.find(".js-switch-to-yourself").on("click",function(e){e.preventDefault(),document.progressLoader=jQuery.progressIndicator({message:app.vtranslate("JS_LOADING_PLEASE_WAIT"),position:"html",blockInfo:{enabled:!0}}),_this2.container.find(".js-text-element").attr("disabled",!0),form.submit();});},/**
         * Register Events
         */registerEvents:function registerEvents(){this.container=jQuery(".switchUsersContainer"),this.registerSave(),this.registerChangeUser();}}),jQuery(document).ready(function(){var instance=new Vtiger_SwitchUsers_Js;instance.registerEvents();});
//# sourceMappingURL=SwitchUsers.min.js.map