public_html/layouts/basic/modules/Accounts/resources/Detail.min.js.map
{"version":3,"file":"Detail.min.js","sources":["Detail.js"],"sourcesContent":["/*+***********************************************************************************\n * The contents of this file are subject to the vtiger CRM Public License Version 1.0\n * (\"License\"); You may not use this file except in compliance with the License\n * The Original Code is: vtiger CRM Open Source\n * The Initial Developer of the Original Code is vtiger.\n * Portions created by vtiger are Copyright (C) vtiger.\n * All Rights Reserved.\n *************************************************************************************/\n'use strict';\n\nVtiger_Detail_Js(\n\t'Accounts_Detail_Js',\n\t{},\n\t{\n\t\t//It stores the Account Hierarchy response data\n\t\taccountHierarchyResponseCache: {},\n\t\t/**\n\t\t * function to get the AccountHierarchy response data\n\t\t * @returns {Promise}\n\t\t */\n\t\tgetAccountHierarchyResponseData: function (params) {\n\t\t\tvar thisInstance = this;\n\t\t\tvar aDeferred = jQuery.Deferred();\n\n\t\t\t//Check in the cache\n\t\t\tif (!jQuery.isEmptyObject(thisInstance.accountHierarchyResponseCache)) {\n\t\t\t\taDeferred.resolve(thisInstance.accountHierarchyResponseCache);\n\t\t\t} else {\n\t\t\t\tAppConnector.request(params).done(function (data) {\n\t\t\t\t\t//store it in the cache, so that we dont do multiple request\n\t\t\t\t\tthisInstance.accountHierarchyResponseCache = data;\n\t\t\t\t\taDeferred.resolve(thisInstance.accountHierarchyResponseCache);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn aDeferred.promise();\n\t\t},\n\n\t\t/*\n\t\t * function to display the AccountHierarchy response data\n\t\t */\n\t\tdisplayAccountHierarchyResponseData: function (data) {\n\t\t\tlet callbackFunction = function () {\n\t\t\t\tapp.showScrollBar($('#hierarchyScroll'), {\n\t\t\t\t\theight: '300px',\n\t\t\t\t\trailVisible: true,\n\t\t\t\t\tsize: '6px'\n\t\t\t\t});\n\t\t\t};\n\t\t\tapp.showModalWindow(data, function (modalContainer) {\n\t\t\t\tApp.Components.Scrollbar.xy($('#hierarchyScroll', modalContainer));\n\t\t\t\tif (typeof callbackFunction == 'function' && $('#hierarchyScroll', modalContainer).height() > 300) {\n\t\t\t\t\tcallbackFunction();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tregisterHierarchyRecordCount: function () {\n\t\t\tvar hierarchyButton = $('.detailViewTitle .hierarchy');\n\t\t\tif (hierarchyButton.length) {\n\t\t\t\tvar params = {\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\taction: 'RelationAjax',\n\t\t\t\t\trecord: app.getRecordId(),\n\t\t\t\t\tmode: 'getHierarchyCount'\n\t\t\t\t};\n\t\t\t\tAppConnector.request(params).done(function (response) {\n\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t$('.detailViewTitle .hierarchy .badge').html(response.result);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tregisterShowHierarchy: function () {\n\t\t\tvar thisInstance = this;\n\t\t\tvar hierarchyButton = $('.detailViewTitle');\n\t\t\tvar url = 'index.php?module=Accounts&view=AccountHierarchy&record=' + app.getRecordId();\n\t\t\thierarchyButton.on('click', '.js-detail__icon, .recordLabelValue', function (e) {\n\t\t\t\tthisInstance.getAccountHierarchyResponseData(url).done(function (data) {\n\t\t\t\t\tthisInstance.displayAccountHierarchyResponseData(data);\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tregisterEvents: function () {\n\t\t\tthis._super();\n\t\t\tthis.registerHierarchyRecordCount();\n\t\t\tthis.registerShowHierarchy();\n\t\t}\n\t}\n);\n"],"names":["Vtiger_Detail_Js","accountHierarchyResponseCache","getAccountHierarchyResponseData","params","thisInstance","aDeferred","jQuery","Deferred","isEmptyObject","AppConnector","request","done","data","resolve","promise","displayAccountHierarchyResponseData","callbackFunction","app","showScrollBar","$","height","railVisible","size","showModalWindow","modalContainer","App","Components","Scrollbar","xy","registerHierarchyRecordCount","hierarchyButton","length","module","getModuleName","action","record","getRecordId","mode","response","success","html","result","registerShowHierarchy","url","on","registerEvents","_super"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA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