Browse Source

Call hook 'show-details'

master
parent
commit
e36b00c956
  1. 1
      README.md
  2. 9
      src/index.js

1
README.md

@ -118,3 +118,4 @@ With the function `register_hook` you can hook into several functions. The follo
* `state-get`: modules can add values into the current state. Parameters: `state`: an object, which can be modified by modules.
* `state-apply`: when a state is applied to the app. Parameters: `state`: state which should be applied.
* `show-details`: called when details are being displayed. Parameters: data (see properties in doc/TwigJS.md), category, dom, callback.

9
src/index.js

@ -228,6 +228,15 @@ function showDetails (data, category) {
div.innerHTML = result
}.bind(this, div))
call_hooks_callback('show-details', data, category, dom,
function (err) {
if (err.length) {
console.log('show-details produced errors:', err)
}
}
)
h = document.createElement('h3')
h.innerHTML = 'Attributes'
dom.appendChild(h)

Loading…
Cancel
Save