Opened 8 years ago

Last modified 8 years ago

#1487 new defect

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 (5)

comment:1 Changed 8 years ago by guest

  • Component changed from Xinha Core to Plugins
  • Owner gogo deleted

comment:2 in reply to: ↑ description Changed 8 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); }

?

}

?

};

comment:3 in reply to: ↑ description Changed 8 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);
	}
  }
};

comment:4 Changed 8 years ago by guest

Sorry, this fix will break Stylist.

comment:5 Changed 8 years ago by gogo

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