* show tooltip for left menu.

This commit is contained in:
Hao Sun
2021-08-16 10:15:53 +08:00
parent 4d42368a7f
commit a6bd22b09d
3 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
?>
</head>
<?php $singleClass = $this->app->getViewType() == 'xhtml' ? 'allow-self-open' : '';?>
<?php if($this->moduleName == 'index' && $this->methodName == 'index' && $this->cookie->hideMenu): ?>
<body class='menu-hide <?php echo $singleClass;?>'>
<?php if($this->moduleName == 'index' && $this->methodName == 'index'): ?>
<body class='menu-<?php echo $this->cookie->hideMenu ? 'hide' : 'show'; ?> <?php echo $singleClass;?>'>
<?php else: ?>
<body class='<?php echo $singleClass;?>'>
<?php endif; ?>
+1
View File
@@ -1,6 +1,7 @@
body {padding-left: 96px;}
#menu {position: fixed; left: 0; top: 0; bottom: 0; background-color: #3C495C; width: 96px; z-index: 1015;}
.menu-show .menu-tip {display: none!important;}
#menuNav {position: absolute; top: 5px; bottom: 40px; width: 100%;}
#menu .nav > li {float: none; padding: 2px 8px;}
#menu .nav > li > a {color: #fff; line-height: 24px; padding: 6px; border-radius: 2px; white-space: nowrap; height: 36px;}
+11 -11
View File
@@ -29,7 +29,7 @@
var $link= $('<a data-pos="menu"></a>')
.attr('data-app', item.code)
// .attr('data-toggle', 'tooltip')
.attr('data-toggle', 'tooltip')
.attr('class', 'show-in-app')
.html(item.title);
@@ -42,7 +42,7 @@
.append($link)
.appendTo($menuMainNav);
// $link.tooltip({title: item.text, container: 'body', placement: 'right'});
$link.tooltip({title: item.text, container: 'body', placement: 'right', tipClass: 'menu-tip'});
if(!defaultApp) defaultApp = item.code;
});
@@ -534,7 +534,7 @@
$(document).on('click', '.open-in-app,.show-in-app', function(e)
{
var $link = $(this);
if($link.is('[data-modal],[data-toggle],.iframe,.not-in-app')) return;
if($link.is('[data-modal],[data-toggle!="tooltip"],.iframe,.not-in-app')) return;
var url = $link.hasClass('show-in-app') ? '' : ($link.attr('href') || $link.data('url'));
if(url && url.indexOf('onlybody=yes') > 0) return;
if(openApp(url, $link.data('app')))
@@ -615,7 +615,7 @@
{
var $body = $('body');
if (toggle === undefined) toggle = $body.hasClass('menu-hide');
$body.toggleClass('menu-hide', !toggle);
$body.toggleClass('menu-hide', !toggle).toggleClass('menu-show', !!toggle);
$.cookie('hideMenu', String(!toggle), {expires: config.cookieLife, path: config.webRoot});
};
@@ -629,13 +629,13 @@
setTimeout(function(){$menu.removeClass('hidden')}, 200);
});
// $('.menu-toggle').each(function()
// {
// $(this).attr('data-toggle', 'tooltip').tooltip({container: 'body', title: function(ele)
// {
// return $(ele).data($('body').hasClass('menu-hide') ? 'unfoldText' : 'collapseText');
// }});
// });
$('.menu-toggle').each(function()
{
$(this).attr('data-toggle', 'tooltip').tooltip({container: 'body', placement: 'right', tipClass: 'menu-tip', title: function()
{
return $(this).data($('body').hasClass('menu-hide') ? 'unfoldText' : 'collapseText');
}});
});
});
}());