Ticket #1487 (new defect)

Opened 2 years ago

Last modified 2 years ago

Disco Bug in Stylist Plugin - activateEditor()

Reported by: guest Owned by:
Priority: normal Milestone: 0.97
Component: Plugins Version: trunk
Severity: normal Keywords: Stylist activateEditor
Cc:

Description

Hi there,

We're using Xinha in our CMS and found a strange bug in stylist plugin. If more than one Xinha is included in a document and you activate the first one an then, very short after that, the second textarea, then you get what we call a disco. The editors toolbars alternatingly activate and deactivate.

User Interface is unusable until you click several times into one of the textareas. This occures in Xinha 0.96beta2 with stylist included.

I could reproduce this inside our CMS and in a local environment.

Change History

  Changed 2 years ago by guest

  • owner deleted
  • component changed from Xinha Core to Plugins

in reply to: ↑ description   Changed 2 years ago by guest

Solved the problem. Adding a simple else statement in Stylist.js solves the issue:

Stylist.prototype.onUpdateToolbar=function(){
  console.log('onUpdateToolbar aufgerufen. TimeoutID : '+this._timeoutID);
  if(this.dialog){
    if(this._timeoutID){
          console.log('clearTimeout() aufgerufen. '+this._timeoutID);
          window.clearTimeout(this._timeoutID)
        } else {      // this is the new statement
        var a=this.editor;
        this._timeoutID=window.setTimeout(function(){a._fillStylist()},250);
        console.log('Neues Timeout gesetzt. ID : '+this._timeoutID);
        }
  }
};

in reply to: ↑ description   Changed 2 years ago by guest

Sorry, left the debbuging output inside, hear's the clean version :

Stylist.prototype.onUpdateToolbar=function(){
  if(this.dialog){
    if(this._timeoutID){
	  window.clearTimeout(this._timeoutID)
	} else {
	var a=this.editor;
	this._timeoutID=window.setTimeout(function(){a._fillStylist()},250);
	}
  }
};

  Changed 2 years ago by guest

Sorry, this fix will break Stylist.

  Changed 2 years ago by gogo

  • milestone changed from 0.96 to 0.97
Note: See TracTickets for help on using tickets.