bundles/org.eclipse.orion.client.ui/web/orion/commands.js
function executeBinding(binding) {
			var invocation = binding.invocation;
			if (invocation) {
				var command = binding.command;
				if (typeof(command.hrefCallback) === 'function') {
					var href = command.hrefCallback.call(invocation.handler || window, invocation);
					if (href.then){
						href.then(function(l){
							window.open(urlModifier(l));
						});
					} else {
						// We assume window open since there's no link gesture to tell us what to do.
						window.open(urlModifier(href));
					}
					return true;
				} else if (invocation.commandRegistry) {
					// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=411282
					invocation.commandRegistry._invoke(invocation);
					return true;
				} else if (command.onClick || command.callback) {
					// TODO: what is this timeout for?
					window.setTimeout(function() {
						(command.onClick || command.callback).call(invocation.handler || window, invocation);
					}, 0);
					return true;
				}
			}
			return false;
		}
function executeBinding(binding) {
			var invocation = binding.invocation;
			if (invocation) {
				var command = binding.command;
				if (typeof(command.hrefCallback) === 'function') {
					var href = command.hrefCallback.call(invocation.handler || window, invocation);
					if (href.then){
						href.then(function(l){
							window.open(urlModifier(l));
						});
					} else {
						// We assume window open since there's no link gesture to tell us what to do.
						window.open(urlModifier(href));
					}
					return true;
				} else if (invocation.commandRegistry) {
					// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=411282
					invocation.commandRegistry._invoke(invocation);
					return true;
				} else if (command.onClick || command.callback) {
					// TODO: what is this timeout for?
					window.setTimeout(function() {
						(command.onClick || command.callback).call(invocation.handler || window, invocation);
					}, 0);
					return true;
				}
			}
			return false;
		}
function executeBinding ( binding ) { var invocation = binding . invocation ; if ( invocation ) { var command = binding . command ; if ( typeof ( command . hrefCallback ) === 'function' ) { var href = command . hrefCallback . call ( invocation . handler || window , invocation ) ; if ( href . then ) { href . then ( function ( l ) { window . open ( urlModifier ( l ) ) ; } ) ; } else { // We assume window open since there's no link gesture to tell us what to do. window . open ( urlModifier ( href ) ) ; } return true ; } else if ( invocation . commandRegistry ) { // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=411282 invocation . commandRegistry . _invoke ( invocation ) ; return true ; } else if ( command . onClick || command . callback ) { // TODO: what is this timeout for? window . setTimeout ( function ( ) { ( command . onClick || command . callback ) . call ( invocation . handler || window , invocation ) ; } , 0 ) ; return true ; } } return false ; }
Executes a binding if possible.
@name orion.commands.executeBinding
@function
@static
@param {Object} binding
@returns {Boolean} <code>true</code> if the binding was executed, <code>false</code> otherwise.
Executes a binding if possible .