Previous Projects/GoalModel-Quoll/javascript/examples/grapheditor/www/js/Sidebar.js
/**
 * Construcs a new sidebar for the given editor.
 */
Construcs a new sidebar for the given editor.
Construcs a new sidebar for the given editor .
function Sidebar(editorUi, container)
{
	this.editorUi = editorUi;
	this.container = container;
	this.palettes = new Object();
	this.taglist = new Object();
	this.showTooltips = true;
	this.graph = editorUi.createTemporaryGraph(this.editorUi.editor.graph.getStylesheet());
	this.graph.cellRenderer.antiAlias = false;
	this.graph.foldingEnabled = false;
	this.highlightNode = null;
	if (!mxClient.IS_IE && !mxClient.IS_IE11)
	{
		this.graph.container.style.display = 'none';
	}
	document.body.appendChild(this.graph.container);
	this.pointerUpHandler = mxUtils.bind(this, function()
	{
		this.showTooltips = true;
	});
	mxEvent.addListener(document, (mxClient.IS_POINTER) ? 'pointerup' : 'mouseup', this.pointerUpHandler);
	this.pointerDownHandler = mxUtils.bind(this, function()
	{
		this.showTooltips = false;
		this.hideTooltip();
	});
	mxEvent.addListener(document, (mxClient.IS_POINTER) ? 'pointerdown' : 'mousedown', this.pointerDownHandler);
	this.pointerMoveHandler = mxUtils.bind(this, function(evt)
	{
		var src = mxEvent.getSource(evt);
		while (src != null)
		{
			if (src == this.currentElt)
			{
				return;
			}
			src = src.parentNode;
		}
		this.hideTooltip();
	});
	mxEvent.addListener(document, (mxClient.IS_POINTER) ? 'pointermove' : 'mousemove', this.pointerMoveHandler);
	this.pointerOutHandler = mxUtils.bind(this, function(evt)
	{
		if (evt.toElement == null && evt.relatedTarget == null)
		{
			this.hideTooltip();
		}
	});
	mxEvent.addListener(document, (mxClient.IS_POINTER) ? 'pointerout' : 'mouseout', this.pointerOutHandler);
	mxEvent.addListener(container, 'scroll', mxUtils.bind(this, function()
	{
		this.showTooltips = true;
	}));
	this.init();
	if (!mxClient.IS_SVG)
	{
		new Image().src = IMAGE_PATH + '/tooltip.png';
	}
}
function Sidebar ( editorUi , container ) { this . editorUi = editorUi ; this . container = container ; this . palettes = new Object ( ) ; this . taglist = new Object ( ) ; this . showTooltips = true ; this . graph = editorUi . createTemporaryGraph ( this . editorUi . editor . graph . getStylesheet ( ) ) ; this . graph . cellRenderer . antiAlias = false ; this . graph . foldingEnabled = false ; this . highlightNode = null ; if ( ! mxClient . IS_IE && ! mxClient . IS_IE11 ) { this . graph . container . style . display = 'none' ; } document . body . appendChild ( this . graph . container ) ; this . pointerUpHandler = mxUtils . bind ( this , function ( ) { this . showTooltips = true ; } ) ; mxEvent . addListener ( document , ( mxClient . IS_POINTER ) ? 'pointerup' : 'mouseup' , this . pointerUpHandler ) ; this . pointerDownHandler = mxUtils . bind ( this , function ( ) { this . showTooltips = false ; this . hideTooltip ( ) ; } ) ; mxEvent . addListener ( document , ( mxClient . IS_POINTER ) ? 'pointerdown' : 'mousedown' , this . pointerDownHandler ) ; this . pointerMoveHandler = mxUtils . bind ( this , function ( evt ) { var src = mxEvent . getSource ( evt ) ; while ( src != null ) { if ( src == this . currentElt ) { return ; } src = src . parentNode ; } this . hideTooltip ( ) ; } ) ; mxEvent . addListener ( document , ( mxClient . IS_POINTER ) ? 'pointermove' : 'mousemove' , this . pointerMoveHandler ) ; this . pointerOutHandler = mxUtils . bind ( this , function ( evt ) { if ( evt . toElement == null && evt . relatedTarget == null ) { this . hideTooltip ( ) ; } } ) ; mxEvent . addListener ( document , ( mxClient . IS_POINTER ) ? 'pointerout' : 'mouseout' , this . pointerOutHandler ) ; mxEvent . addListener ( container , 'scroll' , mxUtils . bind ( this , function ( ) { this . showTooltips = true ; } ) ) ; this . init ( ) ; if ( ! mxClient . IS_SVG ) { new Image ( ) . src = IMAGE_PATH + '/tooltip.png' ; } }
Construcs a new sidebar for the given editor.
Construcs a new sidebar for the given editor .
// Workaround for blank output in IE11- // Handles mouse leaving the window // Enables tooltips after scroll // Pre-fetches tooltip image