Magic links module - adds onclick event to a document body and intercept clicks on hyperlink

Hyperlink should be in form <a href='#' data-cmd-type="commandToRun" ....> In case command specified in cmdType data attribute is registered using addCommand it will be executed. Links samples:

  
      <a href="#" data-cmd-type="showForm" data-entity="ubm_navshortcut", data-instance-id=332352169869385>
   Edit existed shortcut with specified ID
 </a>

 <a href="#" data-cmd-type="setFocus" data-elm-id="ubedit-11223">
   Set focus on edit
 </a>

 <a href="#"
    data-cmd-type="showReport"
    data-cmd-data='{"reportCode":"your-report-code","reportType":"html","reportParams":{"a":"b"},"reportOptions":{"allowExportToExcel":"xls"}}'
 >
   Show report `your-report-code` with parameters
 </a>
  

Methods

# addCommand (commandstring, handlerfunction) inner

Register action for command. Command is passed as <a href="#' data-cmd-type="commandName">. If handler for command already exists it will be overrated

Arguments:
  • command: string
  • handler: function

    Callback what accept (dataObject: Object; EventTarget)

# install () inner

Adds a global onclick event listener. Called by adminui-vue.