You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
660 B
23 lines
660 B
function noop () {}
|
|
|
|
export function initTitleNView (nvue) {
|
|
const eventMaps = {
|
|
onNavigationBarButtonTap: noop,
|
|
onNavigationBarSearchInputChanged: noop,
|
|
onNavigationBarSearchInputConfirmed: noop,
|
|
onNavigationBarSearchInputClicked: noop,
|
|
onNavigationBarSearchInputFocusChanged: noop
|
|
}
|
|
nvue.requireModule('globalEvent').addEventListener('plusMessage', e => {
|
|
if (eventMaps[e.data.type]) {
|
|
eventMaps[e.data.type](e.data.data)
|
|
}
|
|
})
|
|
const ret = Object.create(null)
|
|
Object.keys(eventMaps).forEach(eventType => {
|
|
ret[eventType] = function (callback) {
|
|
eventMaps[eventType] = callback
|
|
}
|
|
})
|
|
return ret
|
|
}
|
|
|