public_html/layouts/resources/helper.min.js
'use strict';
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
* Contributor(s): YetiForce S.A.
*************************************************************************************/"use strict";$.Class("Vtiger_Helper_Js",{checkServerConfigResponseCache:"",langCode:"",/*
* Function to set lang code
*/setLangCode:function setLangCode(){var htmlTag=document.getElementsByTagName("html")[0];this.langCode=htmlTag.getAttribute("lang")?htmlTag.getAttribute("lang"):"en";},/*
* Function to get lang code
*/getLangCode:function getLangCode(){return this.langCode||this.setLangCode(),this.langCode},/*
* Function to get the instance of Mass edit of Email
*/getEmailMassEditInstance:function getEmailMassEditInstance(){var emailMassEditInstance=new window.Emails_MassEdit_Js;return emailMassEditInstance},showMessage:function showMessage(params){"undefined"==typeof params.type&&(params.type="info"),"undefined"==typeof params.title&&(params.title=app.vtranslate("JS_MESSAGE")),app.showNotify(params);},/*
* Function to add clickoutside event on the element - By using outside events plugin
* @params element---On which element you want to apply the click outside event
* @params callbackFunction---This function will contain the actions triggered after clickoutside event
*/addClickOutSideEvent:function addClickOutSideEvent(element,callbackFunction){element.one("clickoutside",callbackFunction);},/*
* Function to show horizontal top scroll bar
*/showHorizontalTopScrollBar:function showHorizontalTopScrollBar(){var container=$(".contentsDiv"),topScroll=$(".contents-topscroll",container),bottomScroll=$(".contents-bottomscroll",container);$(".bottomscroll-div",container).attr("style",""),$(".topscroll-div",container).css("width",$(".bottomscroll-div",container).outerWidth()),$(".bottomscroll-div",container).css("width",$(".topscroll-div",container).outerWidth()),topScroll.on("scroll",function(){bottomScroll.scrollLeft(topScroll.scrollLeft());}),bottomScroll.on("scroll",function(){topScroll.scrollLeft(bottomScroll.scrollLeft());});},hideOptions:function hideOptions(element,attr,value){var opval="";element.find("option").each(function(index,option){option=$(option),value==option.data(attr)?(""==opval&&(opval=option.val()),option.removeClass("d-none"),option.removeAttr("disabled")):(option.addClass("d-none"),option.attr("disabled","disabled"));}),element.val(opval).trigger("change");},unique:function unique(array){return array.filter(function(el,index,arr){return index===arr.indexOf(el)})}},{});
//# sourceMappingURL=helper.min.js.map