* improve UI of tutorial views.

This commit is contained in:
Catouse
2018-06-08 16:08:20 +08:00
parent 900e46d19e
commit 03f38a45f1
2 changed files with 16 additions and 6 deletions
+11 -1
View File
@@ -205,11 +205,21 @@ $(function()
{
if(!$e.length) return;
$e.closest('body').find('[data-toggle=tooltip]').tooltip('destroy');
var offset = $e.offset();
var winWidth = $(window).width();
var placement = 'top';
if (offset.left > (winWidth*2/3)) {
placement = 'left';
} else if (offset.left < (winWidth/3) && (offset.left + $e.outerWidth()) < (winWidth*2/3)) {
placement = 'right';
} else if (offset.top < 50) {
placement = 'bottom';
}
options = $.extend(
{
trigger: 'manual',
title: text,
placement: $e.offset().left > ($(window).width()*2/3) ? 'left' : 'top',
placement: placement,
container: 'body',
tipClass: 'tooltip-warning tooltip-max'
}, options);