Commit 3cac473e authored by Jonny Bradley's avatar Jonny Bradley

[FIX] admin: Add a delay on the admin icon tooltips appearance (added class...

[FIX] admin: Add a delay on the admin icon tooltips appearance (added class "slow") and remove the hide delay (needed for other tooltips which have clickable content) and change the placement to bottom so they don't get in the way so much. Thanks all on the dev list.
parent 3b62f02d
......@@ -274,29 +274,33 @@ $.fn.tiki_popover = function () {
*/
list = $container.find('.tips[title!=""], .tikihelp[title!=""]')
.each(function () {
var element = this;
var $element = $(this);
if ($(this).attr('title')) {
if ($element.attr('title')) {
$.each(['|', ':', '<br/>', '<br>'], function (key, sep) {
var parts = $(element).attr('title').split(sep);
var parts = $element.attr('title').split(sep);
if (parts.length > 1) {
$(element).attr('title', parts.shift());
$(element).data('content', parts.join(sep));
$element.attr('title', parts.shift());
$element.data('content', parts.join(sep));
}
});
} else {
$(this).attr('title', '');
$element.attr('title', '');
}
if (! $(this).data('trigger')) {
$(this).data('trigger', 'hover');
if (! $element.data('trigger')) {
$element.data('trigger', 'hover');
}
// default Tiki delay
$element.data('delay', { "show": 0, "hide": 10 });
});
$.merge(list, $container.find("a[data-toggle=popover]:not(.tips[title!='']):not(.tikihelp[title!=''])"));
list.filter('.bottom').data('placement', 'bottom');
list.filter('.left').data('placement', 'left');
list.filter('.slow').data('delay', { "show": 500, "hide": 0 });
list.find('img').attr('title', ''); // Remove the img title to avoid browser tooltip
list.filter('[data-trigger="click"]')
.click(function (e) {
......@@ -308,7 +312,6 @@ $.fn.tiki_popover = function () {
.popover({
container: 'body',
html: true,
delay: { "show": 0, "hide": 10 },
placement: $.tikiPopoverWhereToPlace
});
......
{*$Id$*}
{foreach from=$admin_icons key=page item=info}
{if ! $info.disabled}
<li><a href="tiki-admin.php?page={$page}" alt="{$info.title} {$info.description}" class="tips icon text-muted" title="{$info.title}|{$info.description}">
<li><a href="tiki-admin.php?page={$page}" alt="{$info.title} {$info.description}" class="tips bottom slow icon text-muted" title="{$info.title}|{$info.description}">
{icon name="admin_$page"}
</a></li>
{/if}
......
......@@ -18,7 +18,7 @@
{else}
{assign var=class value="admbox basic btn btn-primary"}
{/if}
<a href="tiki-admin.php?page={$page}" alt="{$info.title} {$info.description}" class="{$class} tips" title="{$info.title|escape}{if $info.disabled} ({tr}Disabled{/tr}){/if}|{$info.description}">
<a href="tiki-admin.php?page={$page}" alt="{$info.title} {$info.description}" class="{$class} tips bottom slow" title="{$info.title|escape}{if $info.disabled} ({tr}Disabled{/tr}){/if}|{$info.description}">
{icon name="admin_$page"}
<span class="title">{$info.title|escape}</span>
</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment