简体   繁体   English

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

[英]How to disable redactor tooltip entirely?

In redactor when I hover over toolbar buttons, tooltips fly over from left top to the place where toolbar button is placed. 在redactor中,当我将鼠标悬停在工具栏按钮上时,工具提示会从左上角飞到放置工具栏按钮的位置。 This odd behavior makes this tooltip pretty ugly and want to disable it. 这种奇怪的行为使得这个工具提示非常难看,并且想要禁用它。

This link describes disabling inline tooltip, but I'm looking for a way to disable the main tooltips. 此链接描述了禁用内联工具提示,但我正在寻找一种方法来禁用主要工具提示。

How to disable it? 如何禁用它?

The black tool-bar in picture below has tool-tips, I want to disable tool-tips that appear on mouse over, as it has some buggy behavior. 下图中的黑色工具栏有工具提示,我想禁用鼠标上出现的工具提示,因为它有一些错误的行为。
在此输入图像描述

I think you can actually do it using just simple css 我认为你可以使用简单的css实际做到这一点

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

You can not disable it with config or css. 您无法使用config或css禁用它。 The only way I can see is to remove title attribute from anchors in toolbar. 我能看到的唯一方法是从工具栏中的锚点中删除title属性。

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

You can try to run above code after editor is created. 创建编辑器后,您可以尝试运行上面的代码。

For removing tool-tips I did the following: 为了删除工具提示,我执行了以下操作:

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

It worked like a charm! 它就像一个魅力!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM