From 9d433b48f80f84806a6f1bcff2116ddf2960782d Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 7 Apr 2019 16:41:45 +0200 Subject: [PATCH] Suppress additional native browser title of smilies in editor tab Prior to this change, both the `a` element and the `img` element have a `title` attribute with the `a` element being a JavaScript tooltip element. This caused a JavaScript tooltip and a native browser tooltip to be shown when hovering over a smiley in the smiley selection below the editor. See #2220 --- com.woltlab.wcf/templates/__messageFormSmilies.tpl | 2 +- wcfsetup/install/files/lib/data/smiley/Smiley.class.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/com.woltlab.wcf/templates/__messageFormSmilies.tpl b/com.woltlab.wcf/templates/__messageFormSmilies.tpl index bb49b5f545..51e429a193 100644 --- a/com.woltlab.wcf/templates/__messageFormSmilies.tpl +++ b/com.woltlab.wcf/templates/__messageFormSmilies.tpl @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php index 1c5c76a4c8..154a4325fd 100644 --- a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php +++ b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php @@ -81,12 +81,16 @@ class Smiley extends DatabaseObject { /** * Returns the html code to render the smiley. * + * @param string $class (additional) class(es) of the smiley element * @return string */ - public function getHtml() { + public function getHtml($class = '') { $srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : ''; $height = ($this->getHeight()) ? ' height="' . $this->getHeight() . '"' : ''; + if ($class !== '') { + $class = ' ' . $class; + } - return '' . StringUtil::encodeHTML($this->smileyCode) . ''; + return '' . StringUtil::encodeHTML($this->smileyCode) . ''; } } -- 2.20.1