diff --git a/Bootstrap.Admin/Content/js/Longbow.Common.js b/Bootstrap.Admin/Content/js/Longbow.Common.js index f955b5ca..97a762b0 100644 --- a/Bootstrap.Admin/Content/js/Longbow.Common.js +++ b/Bootstrap.Admin/Content/js/Longbow.Common.js @@ -240,6 +240,13 @@ }); that.animate({ marginTop: "+=" + getHeight() }); }, + lgbTooltip: function (option) { + if (option == undefined) option = { container: 'body', delay: { "show": 500, "hide": 100 } }; + else if (typeof option == "object") option = $.extend({ container: 'body', delay: { "show": 500, "hide": 100 } }, option); + $(this).tooltip(option); + if (option == 'destroy') $(this).removeAttr('data-original-title'); + return this; + }, autoValidate: function (rules, messages, handler) { var parent = 'body'; var $wrapper = $('#dialogNew'); @@ -263,13 +270,13 @@ $(element).parents('.form-group').addClass(errorClass).removeClass(validClass); }, unhighlight: function (element, errorClass, validClass) { - $(element).tooltip('destroy').removeAttr('data-original-title').parents('.form-group').removeClass(errorClass).addClass(validClass); + $(element).lgbTooltip('destroy').parents('.form-group').removeClass(errorClass).addClass(validClass); }, errorPlacement: function (label, element) { var $ele = $(element); - if (!$ele.attr('data-original-title')) $ele.tooltip({ container: parent, delay: { "show": 500, "hide": 100 } }); + if (!$ele.attr('data-original-title')) $ele.lgbTooltip({ container: parent }); $ele.attr('data-original-title', $(label).text()); - $ele.tooltip('show') + $ele.lgbTooltip('show') } }); if (handler && $.isArray(handler.button)) { diff --git a/Bootstrap.Admin/Content/js/common-scripts.js b/Bootstrap.Admin/Content/js/common-scripts.js index f8b82da7..33cdf12b 100644 --- a/Bootstrap.Admin/Content/js/common-scripts.js +++ b/Bootstrap.Admin/Content/js/common-scripts.js @@ -55,7 +55,7 @@ $(function () { scrollTop: 0 }, 200); }); - if (!$.browser.versions.mobile) $('[role="tooltip"]').tooltip({ delay: { "show": 500, "hide": 100 } }); + if (!$.browser.versions.mobile) $('[role="tooltip"]').lgbTooltip(); // breadcrumb var arch = $('#nav-accordion').find('a.active').last(); diff --git a/Bootstrap.Admin/Content/js/framework.js b/Bootstrap.Admin/Content/js/framework.js index 61b0117f..cc4c1e9a 100644 --- a/Bootstrap.Admin/Content/js/framework.js +++ b/Bootstrap.Admin/Content/js/framework.js @@ -31,6 +31,7 @@ if (that.options.validateForm && that.options.validateForm.constructor === String) { var v = $('#' + that.options.validateForm); v.validate().resetForm(); + v.find('[data-original-title]').lgbTooltip('destroy'); v.find('.has-error, .has-success').removeClass("has-error has-success"); } }); diff --git a/Bootstrap.Admin/Scripts/Groups.js b/Bootstrap.Admin/Scripts/Groups.js index a67dfb75..2d15fce3 100644 --- a/Bootstrap.Admin/Scripts/Groups.js +++ b/Bootstrap.Admin/Scripts/Groups.js @@ -29,7 +29,7 @@ $dialogRoleHeader.text($.format('{0}-角色授权窗口', row.GroupName)); $dialogRoleForm.html(html).find('[role="tooltip"]').each(function (index, label) { if (label.title == "") label.title = "未设置"; - }).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } }); + }).lgbTooltip(); $dialogRole.modal('show'); } }); @@ -47,7 +47,7 @@ $dialogUserHeader.text($.format('{0}-用户授权窗口', row.GroupName)); $dialogUserForm.html(html).find('[role="tooltip"]').each(function (index, label) { if (label.title == "") label.title = "未设置"; - }).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } }); + }).lgbTooltip(); $dialogUser.modal('show'); } }); diff --git a/Bootstrap.Admin/Scripts/Menus.js b/Bootstrap.Admin/Scripts/Menus.js index a1c8ed21..9fb26e1b 100644 --- a/Bootstrap.Admin/Scripts/Menus.js +++ b/Bootstrap.Admin/Scripts/Menus.js @@ -50,7 +50,7 @@ $dialogRoleHeader.text($.format('{0}-角色授权窗口', row.Name)); $dialogRoleForm.html(html).find('[role="tooltip"]').each(function (index, label) { if (label.title == "") label.title = "未设置"; - }).tooltip({ container: 'body', delay: { "show": 500, "hide": 100 } }); + }).lgbTooltip(); $dialogRole.modal('show'); } }); diff --git a/Bootstrap.Admin/Scripts/Profiles.js b/Bootstrap.Admin/Scripts/Profiles.js index 385edf4f..eadec430 100644 --- a/Bootstrap.Admin/Scripts/Profiles.js +++ b/Bootstrap.Admin/Scripts/Profiles.js @@ -149,7 +149,7 @@ }).join(''); $sortable.append($.format('