(gd)
| 376 | } |
| 377 | |
| 378 | function eraseActiveSelection(gd) { |
| 379 | // Do not allow removal of selections on other dragmodes. |
| 380 | // This ensures the user could still double click to |
| 381 | // deselect all trace.selectedpoints, |
| 382 | // if that's what they wanted. |
| 383 | // Also double click to zoom back won't result in |
| 384 | // any surprising selection removal. |
| 385 | if(!selectMode(gd._fullLayout.dragmode)) return; |
| 386 | |
| 387 | clearOutlineControllers(gd); |
| 388 | |
| 389 | var id = gd._fullLayout._activeSelectionIndex; |
| 390 | var selections = (gd.layout || {}).selections || []; |
| 391 | if(id < selections.length) { |
| 392 | var list = []; |
| 393 | for(var q = 0; q < selections.length; q++) { |
| 394 | if(q !== id) { |
| 395 | list.push(selections[q]); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | delete gd._fullLayout._activeSelectionIndex; |
| 400 | |
| 401 | var erasedSelection = gd._fullLayout.selections[id]; |
| 402 | gd._fullLayout._deselect = { |
| 403 | xref: erasedSelection.xref, |
| 404 | yref: erasedSelection.yref |
| 405 | }; |
| 406 | |
| 407 | Registry.call('_guiRelayout', gd, { |
| 408 | selections: list |
| 409 | }); |
| 410 | } |
| 411 | } |
no test coverage detected
searching dependent graphs…