public_html/layouts/basic/modules/Vtiger/resources/DetailPreview.min.js
'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";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}$.Class("Vtiger_DetailPreview_Js",{},{/**
* Redirects to the clicked link from the iframe.
*/registerLinkEvent:function registerLinkEvent(){$("#page").on("click","a",function(e){e.preventDefault();var target=$(this);(!target.closest("div").hasClass("fieldValue")||target.hasClass("showReferenceTooltip"))&&target.attr("href")&&"#"!=target.attr("href")&&(top.location.href=target.attr("href"));});},/**
* Redirects to the current iframe parent.
*/updateParentFrame:function updateParentFrame(){parent.app.getPageController().updateWindowHeight($(".mainContainer").height(),$(window.frameElement));},/**
* Function sets the correct iframe size.
* @param {jQuery} currentHeight - ifrmae body height to be set.
* @param {jQuery} frame - ifrmae height to be changed.
*/updateWindowHeight:function updateWindowHeight(currentHeight,frame){var thisInstance=this,relatedContents=frame.closest(".relatedContents"),fixedListHeight=relatedContents.find(".js-list-preview--scroll").height();frame.height(currentHeight),fixedListHeight>currentHeight&&(currentHeight=fixedListHeight),relatedContents.find(".gutter, .js-list-preview, .js-side-block, .js-list-detail, .recordsListPreview").height(currentHeight),window.frameElement&&thisInstance.updateParentFrame();},/**
* Creates ResizeSensor, which detects size changes.
*/registerSizeEvent:function registerSizeEvent(){var thisInstance=this;new ResizeSensor($(".mainContainer"),function(){thisInstance.updateParentFrame();});},/**
* Register detail events
*/registerDetailEvent:function registerDetailEvent(){var moduleClassName=app.getModuleName()+"_Detail_Js",parent=!1;"undefined"==typeof window[moduleClassName]&&(moduleClassName="Vtiger_Detail_Js"),"undefined"!=typeof window[moduleClassName]&&("function"==typeof window[moduleClassName]&&(parent=new window[moduleClassName]),"object"===_typeof(window[moduleClassName])&&(parent=window[moduleClassName]),parent&&parent.registerEvents());},updateChatConfig:function updateChatConfig(){window.parent.vuexStore&&window.ChatModalVueComponent&&window.parent.vuexStore.commit("Chat/setDetailPreview",{id:window.app.getRecordId(),module:window.app.getModuleName()});},/**
* Registers DetailPreview events.
*/registerEvents:function registerEvents(){this.registerDetailEvent(),this.registerLinkEvent(),this.registerSizeEvent(),this.updateChatConfig();}});
//# sourceMappingURL=DetailPreview.min.js.map