﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10227	Magicline should carefully register commands, keystrokes and listeners	Piotrek Koszuliński		"This code is executed multiple times when switching between modes. It is hard to predict whether this is safe or not, therefore it should be fixed.

{{{
	// Editor commands for accessing difficult focus spaces.
	editor.addCommand( 'accessPreviousSpace', accessFocusSpaceCmd( that ) );
	editor.addCommand( 'accessNextSpace', accessFocusSpaceCmd( that, true ) );

	editor.setKeystroke( [
		[ config.magicline_keystrokePrevious, 'accessPreviousSpace' ],
		[ config.magicline_keystrokeNext, 'accessNextSpace' ]
	] );

	// Revert magicline hot node on undo/redo.
	editor.on( 'loadSnapshot', function( event ) {
		var elements = doc.getElementsByTag( that.enterBehavior ),
			element;

		for ( var i = elements.count(); i--; ) {
			if ( ( element = elements.getItem( i ) ).hasAttribute( 'data-cke-magicline-hot' ) ) {
				// Restore hotNode
				that.hotNode = element;
				// Restore last access direction
				that.lastCmdDirection = element.getAttribute( 'data-cke-magicline-dir' ) === 'true' ? true : false;
				break;
			}
		}
	} );
}}}"	Bug	confirmed	Normal		General	4.0 Beta			
