YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Users/resources/VisitPurpose.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";$.Class("Users_VisitPurpose_JS",{},{/**
         * Modal container
         */container:!1,/**
         * Function to handle sending the AJAX form
         */registerSave:function registerSave(){var _this=this;this.container.find(".js-modal__save").on("click",function(e){var form=_this.container.find("form");if(e.preventDefault(),form.validationEngine("validate")){var progress=$.progressIndicator({message:app.vtranslate("JS_SAVE_LOADER_INFO"),blockInfo:{enabled:!0}}),formData=form.serializeFormData();app.saveAjax("",[],formData).done(function(data){if(data.result){var id=_this.container.closest(".modalContainer").attr("id");app.hideModalWindow(null,id);}else app.showNotify({text:app.vtranslate("JS_ERROR"),type:"error"});progress.progressIndicator({mode:"hide"});});}});},/**
         * Register base events
         * @param {jQuery} modalContainer
         */registerEvents:function registerEvents(modalContainer){var _this2=this;this.container=modalContainer,this.registerSave(),setTimeout(function(){_this2.container.find("textarea").focus();},400);}});
//# sourceMappingURL=VisitPurpose.min.js.map