From d91282a7671f2a57124226cbd17d895a26e1adda Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Jun 2021 21:01:47 +0200 Subject: [PATCH] render reactions in div instead of ul --- src/platform/web/ui/general/ListView.js | 7 ++++--- src/platform/web/ui/session/room/timeline/ReactionsView.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/platform/web/ui/general/ListView.js b/src/platform/web/ui/general/ListView.js index 749ae6cf..3aed06eb 100644 --- a/src/platform/web/ui/general/ListView.js +++ b/src/platform/web/ui/general/ListView.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {tag} from "./html.js"; +import {el} from "./html.js"; import {errorToDOM} from "./error.js"; function insertAt(parentNode, idx, childNode) { @@ -28,10 +28,11 @@ function insertAt(parentNode, idx, childNode) { } export class ListView { - constructor({list, onItemClick, className, parentProvidesUpdates = true}, childCreator) { + constructor({list, onItemClick, className, tagName = "ul", parentProvidesUpdates = true}, childCreator) { this._onItemClick = onItemClick; this._list = list; this._className = className; + this._tagName = tagName; this._root = null; this._subscription = null; this._childCreator = childCreator; @@ -62,7 +63,7 @@ export class ListView { if (this._className) { attr.className = this._className; } - this._root = tag.ul(attr); + this._root = el(this._tagName, attr); this.loadList(); if (this._onItemClick) { this._root.addEventListener("click", this._onClick); diff --git a/src/platform/web/ui/session/room/timeline/ReactionsView.js b/src/platform/web/ui/session/room/timeline/ReactionsView.js index a0979186..c1250683 100644 --- a/src/platform/web/ui/session/room/timeline/ReactionsView.js +++ b/src/platform/web/ui/session/room/timeline/ReactionsView.js @@ -21,6 +21,7 @@ export class ReactionsView extends ListView { constructor(reactionsViewModel) { const options = { className: "Timeline_messageReactions", + tagName: "div", list: reactionsViewModel.reactions, onItemClick: (reactionView, evt) => reactionView.onClick(), }