如何完全禁用 redactor 工具提示?

How to disable redactor tooltip entirely?

在编辑器中,当我将鼠标悬停在工具栏按钮上时,工具提示会从左上角飞到工具栏按钮所在的位置。这种奇怪的行为使这个工具提示非常丑陋,想要禁用它。

This link 描述了禁用内联工具提示,但我正在寻找一种方法来禁用主工具提示。

如何禁用它?

下图中的黑色工具栏有工具提示,我想禁用鼠标悬停时出现的工具提示,因为它有一些错误行为。

您无法通过配置或 css 禁用它。我能看到的唯一方法是从工具栏中的锚点中删除 title 属性。

Array.prototype.slice
    .call(document.getElementsByClassName('redactor-toolbar')[0].getElementsByTagName('a'), 0)
    .forEach(function(button) {
        button.removeAttribute('title');
    }

您可以在创建编辑器后尝试运行上面的代码。

为了删除工具提示,我执行了以下操作:

$(document).on('click', '.btn', function() {
         $('.redactor-toolbar-tooltip').remove();
}

效果非常好!

我认为您实际上可以使用简单的方法来做到这一点 css

.redactor-toolbar-tooltip{
   display: none !important;
}