Project

General

Profile

Actions

Defect #38915

closed

Duplicate spacer id in jsToolBar

Added by Yasu Saku over 1 year ago. Updated 21 days ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Currently, each spacer in the jsToolBar is assigned an ID.
However, when there are multiple wiki editing areas on a page, this causes issues due to the duplicated IDs.
Therefore, to address this problem, I have created a patch that replaces the ID with a class name as one of the proposed fixes.

--- a/public/javascripts/jstoolbar/jstoolbar.js
+++ b/public/javascripts/jstoolbar/jstoolbar.js
@@ -155,15 +155,14 @@ jsButton.prototype.draw = function() {
   return button;
 }

-function jsSpace(id) {
-  this.id = id || null;
+function jsSpace(className) {
+  this.className = className || null;
   this.width = null;
 }
 jsSpace.prototype.draw = function() {
   var span = document.createElement('span');
-  if (this.id) span.id = this.id;
   span.appendChild(document.createTextNode(String.fromCharCode(160)));
-  span.className = 'jstSpacer';
+  span.className = 'jstSpacer' + (this.className ? ' ' + this.className : '');
   if (this.width) span.style.marginRight = this.width+'px';

   return span;

Actions

Also available in: Atom PDF