Skip to content

Commit

Permalink
Ticket #4641 - Use HTMX to load page content without genaral page str…
Browse files Browse the repository at this point in the history
…ucture.
  • Loading branch information
AntonLV committed Jul 10, 2024
1 parent 24697b3 commit 9e5f45c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions inc/classes/BxDolTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
8 changes: 7 additions & 1 deletion modules/boonex/artificer/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
3 changes: 3 additions & 0 deletions template/scripts/BxBasePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9e5f45c

Please sign in to comment.