From 9e5f45cb869b195c3e3eafbf0c3732847548e278 Mon Sep 17 00:00:00 2001 From: AntonLV Date: Wed, 10 Jul 2024 14:10:17 +0300 Subject: [PATCH] Ticket #4641 - Use HTMX to load page content without genaral page structure. --- inc/classes/BxDolTemplate.php | 9 +++++++++ modules/boonex/artificer/js/utils.js | 8 +++++++- template/scripts/BxBasePage.php | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/inc/classes/BxDolTemplate.php b/inc/classes/BxDolTemplate.php index 108c018e3b..a7b9977d35 100644 --- a/inc/classes/BxDolTemplate.php +++ b/inc/classes/BxDolTemplate.php @@ -1176,6 +1176,15 @@ function addJsTranslation($mixedKey, $bDynamic = false) return $bDynamic ? $this->_processJsTranslations() : ''; } + + /** + * get added js translations + */ + function getJsTranslation($bDynamic = false) + { + return $bDynamic ? $this->_processJsTranslations() : $this->aPage['js_translations']; + } + /** * Add image in JS output. * diff --git a/modules/boonex/artificer/js/utils.js b/modules/boonex/artificer/js/utils.js index 73ec791abb..97c116d42c 100644 --- a/modules/boonex/artificer/js/utils.js +++ b/modules/boonex/artificer/js/utils.js @@ -140,6 +140,12 @@ BxArtificerUtils.prototype.submenuClickBl = function(oElement) { BxArtificerUtils.prototype.submenuClickAl = function(oElement) { var sClass = 'bx-menu-tab-active'; + var oItem = $(oElement).parent().addClass(sClass); + + oItem.siblings().removeClass(sClass); + oItem.siblings('.bx-menu-item-more-auto').find('li').removeClass(sClass); - $(oElement).parent().addClass(sClass).siblings().removeClass(sClass); + oItem.parents('li:first').siblings().removeClass(sClass); + if(oItem.parents('.bx-popup-applied.bx-popup-menu')) + $('.bx-popup-applied:visible').dolPopupHide(); }; \ No newline at end of file diff --git a/template/scripts/BxBasePage.php b/template/scripts/BxBasePage.php index 72643741f8..b340ca718d 100644 --- a/template/scripts/BxBasePage.php +++ b/template/scripts/BxBasePage.php @@ -198,6 +198,9 @@ public function getIncludes () $sResult .= $oTemplate->addCss($a['url'], true); foreach ($aJs as $a) $sResult .= $oTemplate->addJs($a['url'], true); + + // add js translations + $sResult .= $oTemplate->getJsTranslation(true); return $sResult; }