移除所有使用tipso提示框,改用系统自带的tooltip控件

This commit is contained in:
Argo-Surface 2017-01-14 16:45:12 +08:00 committed by Argo-Lenovo
parent d592b945ea
commit 285069d7a9
9 changed files with 23 additions and 27 deletions

View File

@ -118,7 +118,7 @@
url: this.url,
data: {},
method: "POST",
htmlTemplate: '<div class="form-group checkbox col-md-3 col-sm-4 col-xs-6"><label class="tipso_style" title="{3}"><input type="checkbox" value="{0}" {2}/>{1}</label></div>',
htmlTemplate: '<div class="form-group checkbox col-md-3 col-sm-4 col-xs-6"><label role="tooltip" title="{3}"><input type="checkbox" value="{0}" {2}/>{1}</label></div>',
title: this.title,
swal: true,
modal: null,

View File

@ -27,9 +27,9 @@
return $.format(htmlTemplate, element.ID, element.RoleName, element.Checked, element.Description);
}).join('')
$dialogRoleHeader.text($.format('{0}-角色授权窗口', row.GroupName));
$dialogRoleForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogRoleForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogRole.modal('show');
}
});
@ -45,9 +45,9 @@
return $.format(htmlTemplate, element.ID, element.DisplayName, element.Checked, element.UserName);
}).join('');
$dialogUserHeader.text($.format('{0}-用户授权窗口', row.GroupName));
$dialogUserForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogUserForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogUser.modal('show');
}
});

View File

@ -48,9 +48,9 @@
return $.format(htmlTemplate, element.ID, element.RoleName, element.Checked, element.Description);
}).join('')
$dialogRoleHeader.text($.format('{0}-角色授权窗口', row.Name));
$dialogRoleForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogRoleForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogRole.modal('show');
}
});

View File

@ -105,7 +105,7 @@
if (result && options.key == '') {
result = $.parseJSON(result);
if ($.isArray(result)) {
var html = '<li class="{4}"><i class="fa fa-ellipsis-v"></i><div class="task-title"><span class="task-title-sp" title="{1}">{2}</span><span class="badge badge-sm label-success">{0}</span><span class="task-value" title="{3}">{3}</span><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o tipso_style" title="{1}" data-key="{1}" data-url="{5}"></button></div></div></li>';
var html = '<li class="{4}"><i class="fa fa-ellipsis-v"></i><div class="task-title"><span class="task-title-sp" title="{1}">{2}</span><span class="badge badge-sm label-success">{0}</span><span class="task-value" title="{3}">{3}</span><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o" title="{1}" data-key="{1}" data-url="{5}" role="tooltip" data-placement="left"></button></div></div></li>';
var content = result.sort(function (x, y) {
return x.Key > y.Key ? 1 : -1;
}).map(function (ele) {
@ -149,7 +149,7 @@
}).join('');
$sortable.append($.format('<li class="title">{0}-{1}</li>', options.item.Desc, options.item.Key));
$sortable.append(content);
if (!$.browser.versions.mobile) $sortable.find('.tipso_style').tipso({ position: 'left', width: 400 });
if (!$.browser.versions.mobile) $sortable.find('[role="tooltip"]').tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
}
}
}
@ -157,12 +157,8 @@
}
$('#refreshCache').click(function () { listCacheUrl(); }).trigger('click');
$('#clearCache').click(function () { listCacheUrl({ clear: true }); });
if (!$.browser.versions.mobile) {
$('#refreshCache').tipso({ width: 70, position: 'left' });
$('#clearCache').tipso({ width: 180, position: 'left' });
}
$sortable.on('click', '.btn', function () {
if ($(this).hasClass('tipso_style')) $(this).tipso('hide').tipso('destroy');
$(this).tooltip('destroy');
listCache({ key: $(this).attr('data-key'), url: $(this).attr('data-url') });
listCacheUrl();
});

View File

@ -33,9 +33,9 @@
return $.format(htmlTemplate, element.ID, element.DisplayName, element.Checked, element.UserName);
}).join('');
$dialogUserHeader.text($.format('{0}-用户授权窗口', row.RoleName));
$dialogUserForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogUserForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogUser.modal('show');
}
});
@ -51,9 +51,9 @@
return $.format(htmlTemplate, element.ID, element.GroupName, element.Checked, element.Description);
}).join('');
$dialogGroupHeader.text($.format('{0}-部门授权窗口', row.RoleName));
$dialogGroupForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogGroupForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogGroup.modal('show');
}
});

View File

@ -29,9 +29,9 @@
return $.format(htmlTemplate, element.ID, element.RoleName, element.Checked, element.Description);
}).join('')
$dialogRoleHeader.text($.format('{0}-角色授权窗口', row.DisplayName));
$dialogRoleForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogRoleForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogRole.modal('show');
}
});
@ -47,9 +47,9 @@
return $.format(htmlTemplate, element.ID, element.GroupName, element.Checked, element.Description);
}).join('');
$dialogGroupHeader.text($.format('{0}-部门授权窗口', row.DisplayName));
$dialogGroupForm.html(html).find('.tipso_style').each(function (index, label) {
$dialogGroupForm.html(html).find('[role="tooltip"]').each(function (index, label) {
if (label.title == "") label.title = "未设置";
}).tipso();
}).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$dialogGroup.modal('show');
}
});

View File

@ -1,7 +1,7 @@
$(function () {
var $btnRefreshUser = $('#refreshUsers');
var htmlNewUsersHeader = '<li class="task-header"><div class="task-title notifi"><span class="task-title-sp">登陆名称</span><span class="task-value">显示名称/备注</span><span class="task-time">注册时间</span><div class="pull-right task-oper">操作</div></div></li>';
var htmlNewUsers = '<li class="list-primary"><i class="fa fa-ellipsis-v"></i><div class="task-title notifi"><span class="task-title-sp">{0}</span><span class="task-value">{4}{1}</span><span class="task-time">{2}</span><div class="pull-right hidden-phone"><button class="btn btn-success btn-xs fa fa-check tipso_style" data-id="{3}" data-result="1" title="同意授权"></button><button class="btn btn-danger btn-xs fa fa-remove tipso_style" data-id="{3}" data-result="0" title="拒绝授权"></button></div></div></li>';
var htmlNewUsers = '<li class="list-primary"><i class="fa fa-ellipsis-v"></i><div class="task-title notifi"><span class="task-title-sp">{0}</span><span class="task-value">{4}{1}</span><span class="task-time">{2}</span><div class="pull-right hidden-phone"><button class="btn btn-success btn-xs fa fa-check" role="tooltip" data-id="{3}" data-result="1" title="同意授权"></button><button class="btn btn-danger btn-xs fa fa-remove" role="tooltip" data-id="{3}" data-result="0" title="拒绝授权"></button></div></div></li>';
function listData() {
$btnRefreshUser.toggleClass('fa-spin');
@ -15,7 +15,7 @@
return $.format(htmlNewUsers, noti.UserName, noti.Description, noti.RegisterTime, noti.ID, noti.DisplayName);
}).join('');
$taskUsers.append(content);
if (!$.browser.versions.mobile) $('#tasks-users').find('.tipso_style').tipso({ position: 'top', width: 100 });
if (!$.browser.versions.mobile) $('#tasks-users').find('[role="tooltip"]').tooltip({ delay: { "show": 500, "hide": 100 } });
}
$btnRefreshUser.toggleClass('fa-spin');
}
@ -26,7 +26,7 @@
$btnRefreshUser.on('click', function () {
listData();
});
if (!$.browser.versions.mobile) $btnRefreshUser.tipso({ position: 'left', width: 100 });
if (!$.browser.versions.mobile) $btnRefreshUser.tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } });
$('#tasks-users').on('click', 'button', function () {
var id = $(this).attr('data-id');

View File

@ -12,7 +12,7 @@
<link href="~/Content/css/tasks.css" rel="stylesheet" />
}
<div class="panel panel-default">
<div class="panel-heading">用户注册<span class="pull-right"><a id="refreshUsers" href="javascript:;" class="fa fa-refresh tipso_style" title="点击刷新"></a></span></div>
<div class="panel-heading">用户注册<span class="pull-right"><a id="refreshUsers" href="javascript:;" class="fa fa-refresh" title="点击刷新" role="tooltip" data-placement="left"></a></span></div>
<div class="panel-body">
<div class="tasks-widget">
<ul id="tasks-users" class="task-list ui-sortable">

View File

@ -64,7 +64,7 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">网站缓存<a id="clearCache" href="#" class="clearcache fa fa-times-circle-o" data-admin="@LgbPrincipal.IsAdmin(Model.UserName)" title="全部清除(WebAdmin可用)"></a><a id="refreshCache" href="#" class="pull-right fa fa-refresh" title="点击刷新"></a></div>
<div class="panel-heading">网站缓存<a id="clearCache" href="#" class="clearcache fa fa-times-circle-o" data-admin="@LgbPrincipal.IsAdmin(Model.UserName)" title="全部清除(WebAdmin可用)" role="tooltip" data-placement="left"></a><a id="refreshCache" href="#" class="pull-right fa fa-refresh" title="点击刷新" role="tooltip"></a></div>
<div class="panel-body">
<div class="tasks-widget">
<ul id="sortable" class="task-list ui-sortable"></ul>