YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Partners/resources/Detail.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";Vtiger_Detail_Js("Partners_Detail_Js",{},{hierarchyResponseCache:{},/**
         * Get response data
         * @param {Object} params
         * @returns {Object}
         */getHierarchyResponseData:function getHierarchyResponseData(params){var thisInstance=this,aDeferred=jQuery.Deferred();return jQuery.isEmptyObject(thisInstance.hierarchyResponseCache)?AppConnector.request(params).done(function(data){thisInstance.hierarchyResponseCache=data,aDeferred.resolve(thisInstance.hierarchyResponseCache);}):aDeferred.resolve(thisInstance.hierarchyResponseCache),aDeferred.promise()},/**
         * Display hierarchy count
         */registerHierarchyRecordCount:function registerHierarchyRecordCount(){var hierarchyButton=$(".detailViewTitle .hierarchy");if(hierarchyButton.length){var params={module:app.getModuleName(),action:"RelationAjax",record:app.getRecordId(),mode:"getHierarchyCount"};AppConnector.request(params).done(function(response){response.success&&$(".detailViewTitle .hierarchy .badge").html(response.result);});}},/**
         * Display hierarchy
         */registerShowHierarchy:function registerShowHierarchy(){var thisInstance=this,hierarchyButton=$(".detailViewTitle"),params={module:app.getModuleName(),view:"Hierarchy",record:app.getRecordId()};hierarchyButton.on("click",".js-detail__icon",function(){thisInstance.getHierarchyResponseData(params).done(function(data){app.showModalWindow(data);});});},registerEvents:function registerEvents(){this._super(),this.registerHierarchyRecordCount(),this.registerShowHierarchy();}});
//# sourceMappingURL=Detail.min.js.map