@@ -175,15 +175,16 @@ define(["iter2d", "csshelper", "evileval", "net", "ui"], function(iter2d, csshel
175
175
} ;
176
176
177
177
178
-
178
+ var currentCell ;
179
179
var addEditor = function ( exquis , makeEditorView , makeEditorController ) {
180
180
exquis . editorController = makeEditorController ( exquis , makeEditorView ) ;
181
181
182
182
iter2d . forEach2dArray ( exquis . cells , function ( cell ) {
183
183
var edit = function ( ) {
184
- if ( exquis . targetCell ) { csshelper . removeClass ( exquis . targetCell . hint , "visible-cell" ) ; }
185
- exquis . targetCell = cell ;
186
- csshelper . addClass ( exquis . targetCell . hint , "visible-cell" ) ;
184
+ if ( currentCell ) { csshelper . removeClass ( currentCell . hint , "visible-cell" ) ; }
185
+ currentCell = cell ;
186
+ exquis . currentCell = currentCell ; //only for debugging
187
+ csshelper . addClass ( currentCell . hint , "visible-cell" ) ;
187
188
exquis . editorController . updateWithCanvasAnim ( cell . canvasAnim ) ;
188
189
exquis . editorController . show ( ) ;
189
190
} ;
@@ -197,7 +198,7 @@ define(["iter2d", "csshelper", "evileval", "net", "ui"], function(iter2d, csshel
197
198
if ( event . target . tagName === "HTML" ) {
198
199
// unselect edition
199
200
exquis . editorController . hide ( ) ;
200
- if ( exquis . targetCell ) { csshelper . removeClass ( exquis . targetCell . hint , "visible-cell" ) ; }
201
+ if ( currentCell ) { csshelper . removeClass ( currentCell . hint , "visible-cell" ) ; }
201
202
}
202
203
} ;
203
204
document . addEventListener ( 'click' , possiblyHideEditor , true ) ;
@@ -261,9 +262,7 @@ define(["iter2d", "csshelper", "evileval", "net", "ui"], function(iter2d, csshel
261
262
try {
262
263
canvasAnim . draw ( neighbouringBorders ) ;
263
264
} catch ( e ) {
264
- if ( exquis . targetCell === cell ) {
265
- exquis . editorController . displayInvalidity ( e ) ;
266
- }
265
+ exquis . editorController . displayInvalidity ( e , cell . canvasAnim ) ;
267
266
}
268
267
} ) ;
269
268
} ;
0 commit comments