Skip to content

Commit

Permalink
[4.0] Mitigate some b/c breaks2 (#32357)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Feb 12, 2021
1 parent 8075b01 commit e5a8e52
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 137 deletions.
Expand Up @@ -14,7 +14,7 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

HTMLHelper::_('bootstrap.dropdown');
HTMLHelper::_('bootstrap.dropdown', '.dropdown-toggle');

$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
8 changes: 2 additions & 6 deletions build/media_source/vendor/bootstrap/js/tab.es6.js
Expand Up @@ -12,11 +12,7 @@ window.bootstrap.Tab = Tab;
*/
Joomla.initialiseTabs = (el, options) => {
if (!(el instanceof Element) && options.isJoomla) {
const nSelector = el.split('.')[1];
if (!nSelector) {
throw new Error('The selector is invalid, check your PHP side');
}
const tab = document.querySelector(`#${nSelector}Content`);
const tab = document.querySelector(`${el}Content`);
if (tab) {
const related = Array.from(tab.children);

Expand All @@ -28,7 +24,7 @@ Joomla.initialiseTabs = (el, options) => {
}

const isActive = element.dataset.active !== '';
const ul = document.querySelector(`#${nSelector}Tabs`);
const ul = document.querySelector(`${el}Tabs`);

if (ul) {
const link = document.createElement('a');
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/profile/edit.php
Expand Up @@ -14,7 +14,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip');

// Load user_profile plugin language
$lang = Factory::getLanguage();
Expand Down
3 changes: 1 addition & 2 deletions layouts/libraries/html/bootstrap/tab/addtab.php
Expand Up @@ -11,10 +11,9 @@

$id = empty($displayData['id']) ? '' : $displayData['id'];
$active = empty($displayData['active']) ? '' : $displayData['active'];
$selector = empty($displayData['selector']) ? '' : $displayData['selector'];
$title = empty($displayData['title']) ? '' : $displayData['title'];
?>
<div id="<?php echo $id; ?>"
<div id="<?php echo preg_replace('/^[\.#]/', '', $id); ?>"
class="tab-pane<?php echo $active; ?>"
data-active="<?php echo trim(htmlspecialchars($active, ENT_COMPAT, 'UTF-8')); ?>"
data-id="<?php echo htmlspecialchars($id, ENT_COMPAT, 'UTF-8'); ?>"
Expand Down
4 changes: 1 addition & 3 deletions layouts/libraries/html/bootstrap/tab/starttabset.php
Expand Up @@ -10,9 +10,7 @@
defined('_JEXEC') or die;

$selector = empty($displayData['selector']) ? '' : $displayData['selector'];

$selector = ltrim($selector, '.');
?>

<ul class="joomla-tabs nav nav-tabs" id="<?php echo $selector; ?>Tabs" role="tablist"></ul>
<ul class="joomla-tabs nav nav-tabs" id="<?php echo preg_replace('/^[\.#]/', '', $selector); ?>Tabs" role="tablist"></ul>
<div class="tab-content" id="<?php echo $selector; ?>Content">
2 changes: 1 addition & 1 deletion libraries/src/Form/Field/SpacerField.php
Expand Up @@ -83,7 +83,7 @@ protected function getLabel()
// If a description is specified, use it to build a tooltip.
if (!empty($this->description))
{
HTMLHelper::_('bootstrap.popover');
HTMLHelper::_('bootstrap.popover', '.hasPopover');
$label .= ' title="' . htmlspecialchars(trim($text, ':'), ENT_COMPAT, 'UTF-8') . '"';
$label .= ' data-bs-content="' . htmlspecialchars(
$this->translateDescription ? Text::_($this->description) : $this->description,
Expand Down

0 comments on commit e5a8e52

Please sign in to comment.