Opened 9 years ago

Last modified 8 years ago

#1137 new defect

[Equation] FF3 fixes & improved way of avoiding formula changes in editor

Reported by: ray Owned by:
Priority: normal Milestone:
Component: Plugins Version:
Severity: normal Keywords:
Cc:

Description

due to various reasons the design of the plugin only allows changing the formula in the plugin's popup formula editor. Previously changing the formula in the editor was avoided by selecting the whole node when the cursor was in it, which was not the best solution. Now, when the cursor is in the formula, key inputs like characters, delete, and backspace are simply cancelled

Change History (1)

comment:1 Changed 8 years ago by guest

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

I have been trying to fix this issue but have not had much success. I have however slightly improved the behavior and made it so that if you are inside the block of math and press delete/backspace, the entire equation is removed. Works in FF3 and IE7. It behaves weirdly when you're pressing backspace with the caret after the equation, but it's better than completely ignoring the keystrokes.

Code added to onKeyPress in the plugin:

e=this.editor;
var currNode = e._getFirstAncestor(e.getSelection(),["span"]);
if (ev.keyCode == 8 || ev.keyCode == 46) {
	if (currNode && currNode.className == "AM") {
		Xinha.removeFromParent(currNode);
		Xinha._stopEvent(ev);
	}
}

This is about as much as I can figure out to do. Maybe someone else can add code to detect if we are immediately after an equation block and delete the equation block? (Or before if delete was pressed)

Niraj.

Note: See TracTickets for help on using tickets.