Skip to content

Commit

Permalink
PCON-152 Fixed bootstrap tooltips by providing default values
Browse files Browse the repository at this point in the history
  • Loading branch information
jatitoam committed Oct 11, 2017
1 parent 5add401 commit 2ebda6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions extensions/libraries/redcore/form/fields/rmedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ function closeModal(fieldId)
$html[] = '<div class="' . $inputClass . '">';

// The Preview.
$preview = (string) $this->element['preview'];
$showPreview = true;
$preview = (string) $this->element['preview'];
$showPreview = true;
$showAsTooltip = false;

switch ($preview)
Expand All @@ -160,8 +160,9 @@ function closeModal(fieldId)
case 'tooltip':
default:
$showAsTooltip = true;
$options = array(
'onShow' => 'jMediaRefreshPreviewTip',
$options = array(
'onShow' => 'jMediaRefreshPreviewTip',
'trigger' => 'hover, focus'
);
JHtml::_('rbootstrap.tooltip', '.hasTipPreview', $options);
break;
Expand Down
2 changes: 1 addition & 1 deletion extensions/libraries/redcore/html/rbootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public static function tooltip($selector = '.hasTooltip', $params = array())
$opt['placement'] = (isset($params['placement']) && ($params['placement'])) ? (string) $params['placement'] : null;
$opt['selector'] = (isset($params['selector']) && ($params['selector'])) ? (string) $params['selector'] : null;
$opt['title'] = (isset($params['title']) && ($params['title'])) ? (string) $params['title'] : null;
$opt['trigger'] = (isset($params['trigger']) && ($params['trigger'])) ? (string) $params['trigger'] : null;
$opt['trigger'] = (isset($params['trigger']) && ($params['trigger'])) ? (string) $params['trigger'] : 'hover focus';
$opt['delay'] = (isset($params['delay']) && ($params['delay'])) ? (is_array($params['delay']) ? $params['delay'] : (int) $params['delay']) : null;
$opt['container'] = (isset($params['container']) && ($params['container'])) ? (int) $params['container'] : 'body';
$opt['template'] = isset($params['template']) ? (string) $params['template'] : null;
Expand Down

0 comments on commit 2ebda6d

Please sign in to comment.