bundles/org.eclipse.orion.client.ui/web/gcli/util/util.js
function withCommand(element, action) {
  var command = element.getAttribute('data-command');
  if (!command) {
    command = element.querySelector('*[data-command]')
            .getAttribute('data-command');
  }

  if (command) {
    action(command);
  }
  else {
    console.warn('Missing data-command for ' + util.findCssSelector(element));
  }
}
function withCommand(element, action) {
  var command = element.getAttribute('data-command');
  if (!command) {
    command = element.querySelector('*[data-command]')
            .getAttribute('data-command');
  }

  if (command) {
    action(command);
  }
  else {
    console.warn('Missing data-command for ' + util.findCssSelector(element));
  }
}
function withCommand ( element , action ) { var command = element . getAttribute ( 'data-command' ) ; if ( ! command ) { command = element . querySelector ( '*[data-command]' ) . getAttribute ( 'data-command' ) ; } if ( command ) { action ( command ) ; } else { console . warn ( 'Missing data-command for ' + util . findCssSelector ( element ) ) ; } }
Helper to find the 'data-command' attribute and call some action on it.
@see |updateCommand()| and |executeCommand()|
Helper to find the data - command attribute and call some action on it .