javascript/examples/grapheditor/www/js/Editor.js
function(sender, evt)
	{
		var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
		var model = graph.getModel();
		var cells = [];
		
		for (var i = 0; i < cand.length; i++)
		{
			if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
			{
				cells.push(cand[i]);
			}
		}
		
		graph.setSelectionCells(cells);
	}
function(sender, evt)
	{
		var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
		var model = graph.getModel();
		var cells = [];
		
		for (var i = 0; i < cand.length; i++)
		{
			if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
			{
				cells.push(cand[i]);
			}
		}
		
		graph.setSelectionCells(cells);
	}
function ( sender , evt ) { var cand = graph . getSelectionCellsForChanges ( evt . getProperty ( 'edit' ) . changes ) ; var model = graph . getModel ( ) ; var cells = [ ] ; for ( var i = 0 ; i < cand . length ; i ++ ) { if ( ( model . isVertex ( cand [ i ] ) || model . isEdge ( cand [ i ] ) ) && graph . view . getState ( cand [ i ] ) != null ) { cells . push ( cand [ i ] ) ; } } graph . setSelectionCells ( cells ) ; }
Keeps the selection in sync with the history
Keeps the selection in sync with the history