<style>
woltlab-mention {
- background-color: rgb(240, 248, 255);
- border: 1px solid rgb(52, 152, 219);
+ background-color: rgb(241, 246, 251);
+ border: 1px solid rgb(176, 200, 224);
+ border-radius: 2px;
display: inline-block;
margin: 0 3px;
padding: 0 2px;
}
+
+ woltlab-mention::before {
+ color: rgb(125, 130, 135);
+ content: "@";
+ padding-right: 2px;
+ }
+
+ woltlab-mention::after {
+ color: rgb(44, 62, 80);
+ content: attr(data-username);
+ }
</style>
<script data-relocate="true">
define(['Ajax', 'Environment', 'EventHandler', 'Ui/Alignment'], function(Ajax, Environment, EventHandler, UiAlignment) {
"use strict";
+ var _dropdownContainer = null;
+
function UiRedactorMention(redactor) { this.init(redactor); }
UiRedactorMention.prototype = {
init: function(redactor) {
elAttr(mention, 'contenteditable', 'false');
elData(mention, 'user-id', elData(item, 'user-id'));
elData(mention, 'username', elData(item, 'username'));
- mention.textContent = elData(item, 'username');
// U+200C = zero width non-joiner
var text = document.createTextNode('\u200c');
if (this._dropdownMenu === null) {
this._dropdownMenu = elCreate('ol');
this._dropdownMenu.className = 'dropdownMenu';
- elById('dropdownMenuContainer').appendChild(this._dropdownMenu);
+
+ if (_dropdownContainer === null) {
+ _dropdownContainer = elCreate('div');
+ _dropdownContainer.className = 'dropdownMenuContainer';
+ document.body.appendChild(_dropdownContainer);
+ }
+
+ _dropdownContainer.appendChild(this._dropdownMenu);
}
this._dropdownMenu.innerHTML = '';