public_html/layouts/basic/modules/Vtiger/resources/DetailPreview.min.js.map
{"version":3,"file":"DetailPreview.min.js","sources":["DetailPreview.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\n$.Class(\n\t'Vtiger_DetailPreview_Js',\n\t{},\n\t{\n\t\t/**\n\t\t * Redirects to the clicked link from the iframe.\n\t\t */\n\t\tregisterLinkEvent: function () {\n\t\t\t$('#page').on('click', 'a', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlet target = $(this);\n\t\t\t\tif (!target.closest('div').hasClass('fieldValue') || target.hasClass('showReferenceTooltip')) {\n\t\t\t\t\tif (target.attr('href') && target.attr('href') != '#') {\n\t\t\t\t\t\ttop.location.href = target.attr('href');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Redirects to the current iframe parent.\n\t\t */\n\t\tupdateParentFrame: function () {\n\t\t\tparent.app.getPageController().updateWindowHeight($('.mainContainer').height(), $(window.frameElement));\n\t\t},\n\t\t/**\n\t\t * Function sets the correct iframe size.\n\t\t * @param {jQuery} currentHeight - ifrmae body height to be set.\n\t\t * @param {jQuery} frame - ifrmae height to be changed.\n\t\t */\n\t\tupdateWindowHeight: function (currentHeight, frame) {\n\t\t\tlet thisInstance = this;\n\t\t\tlet relatedContents = frame.closest('.relatedContents');\n\t\t\tlet fixedListHeight = relatedContents.find('.js-list-preview--scroll').height();\n\t\t\tframe.height(currentHeight);\n\t\t\tif (fixedListHeight > currentHeight) {\n\t\t\t\tcurrentHeight = fixedListHeight;\n\t\t\t}\n\t\t\trelatedContents\n\t\t\t\t.find('.gutter, .js-list-preview, .js-side-block, .js-list-detail, .recordsListPreview')\n\t\t\t\t.height(currentHeight);\n\n\t\t\tif (window.frameElement) {\n\t\t\t\tthisInstance.updateParentFrame();\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Creates ResizeSensor, which detects size changes.\n\t\t */\n\t\tregisterSizeEvent: function () {\n\t\t\tlet thisInstance = this;\n\t\t\tnew ResizeSensor($('.mainContainer'), function () {\n\t\t\t\tthisInstance.updateParentFrame();\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register detail events\n\t\t */\n\t\tregisterDetailEvent: function () {\n\t\t\tlet moduleClassName = app.getModuleName() + '_Detail_Js',\n\t\t\t\tparent = false;\n\t\t\tif (typeof window[moduleClassName] === 'undefined') {\n\t\t\t\tmoduleClassName = 'Vtiger_Detail_Js';\n\t\t\t}\n\t\t\tif (typeof window[moduleClassName] !== 'undefined') {\n\t\t\t\tif (typeof window[moduleClassName] === 'function') {\n\t\t\t\t\tparent = new window[moduleClassName]();\n\t\t\t\t}\n\t\t\t\tif (typeof window[moduleClassName] === 'object') {\n\t\t\t\t\tparent = window[moduleClassName];\n\t\t\t\t}\n\t\t\t\tif (parent) {\n\t\t\t\t\tparent.registerEvents();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tupdateChatConfig() {\n\t\t\tif (window.parent.vuexStore && window.ChatModalVueComponent) {\n\t\t\t\twindow.parent.vuexStore.commit('Chat/setDetailPreview', {\n\t\t\t\t\tid: window.app.getRecordId(),\n\t\t\t\t\tmodule: window.app.getModuleName()\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Registers DetailPreview events.\n\t\t */\n\t\tregisterEvents: function () {\n\t\t\tthis.registerDetailEvent();\n\t\t\tthis.registerLinkEvent();\n\t\t\tthis.registerSizeEvent();\n\t\t\tthis.updateChatConfig();\n\t\t}\n\t}\n);\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","$","Class","registerLinkEvent","on","e","preventDefault","target","closest","hasClass","attr","top","location","href","updateParentFrame","parent","app","getPageController","updateWindowHeight","height","window","frameElement","currentHeight","frame","thisInstance","relatedContents","fixedListHeight","find","registerSizeEvent","ResizeSensor","registerDetailEvent","moduleClassName","getModuleName","registerEvents","updateChatConfig","vuexSt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