org.foam.orion.client/usecasePlugin/web/orion/commands.js
/**
		 * 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.
Executes a binding if possible .
function executeBinding(binding) {
			var invocation = binding.invocation;
			if (invocation) {
				var command = binding.command;
				if (command.hrefCallback) {
					var href = command.hrefCallback.call(invocation.handler || window, invocation);
					if (href.then){
						href.then(function(l){
							window.open(l);
						});
					} else {
						window.open(href);
					}
					return true;
				} else if (invocation.commandRegistry) {
					invocation.commandRegistry._invoke(invocation);
					return true;
				} else if (command.onClick || command.callback) {
					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 ( command . hrefCallback ) { var href = command . hrefCallback . call ( invocation . handler || window , invocation ) ; if ( href . then ) { href . then ( function ( l ) { window . open ( l ) ; } ) ; } else { window . open ( href ) ; } return true ; } else if ( invocation . commandRegistry ) { invocation . commandRegistry . _invoke ( invocation ) ; return true ; } else if ( command . onClick || command . callback ) { window . setTimeout ( function ( ) { ( command . onClick || command . callback ) . call ( invocation . handler || window , invocation ) ; } , 0 ) ; return true ; } } return false ; }
Executes a binding if possible.
Executes a binding if possible .
// We assume window open since there's no link gesture to tell us what to do. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=411282 // TODO: what is this timeout for?