I would like to put the pop-up main_menu written in the setting.js
to my custom button. It seems that the path name I use is not correct.
l('Menu', 'main_menu', { attributes: { 'data-icon': 'star' } })
I also tried this and does not successful. The second parameter in l( )
link path is needed.
l('Menu', { attributes: { 'data-icon': 'star' }, popup: true, popup_delta: 'main_menu' })
So, what is the correct path name of the main_menu? or how do I link my custom menu to my custom button or link?
This is how I do my custom popup button:
var btn_setup = theme('popup', {
content: theme('jqm_item_list', {
items: [
l('View profile', 'user'),
l('Login', 'user/login'),
l('Logout', 'user/logout')
]
}),
button_text: 'Setup',
button_attributes: {
'data-icon': 'gear'
}
});
It does not popup anthing, even I just put a simple content, such as:
content:'<p>This is a test</p>'
nothing happen when clicking the button.
After several experiments, the popup function needs to set the page id.
var btn_setup = theme('popup', {
content: theme('jqm_item_list', {
items: [
l('View profile', 'user'),
l('Login', 'user/login'),
l('Logout', 'user/logout')
]
}),
attributes: {
id: drupalgap_get_page_id() + '_this_page_hook'
},
button_text: 'Setup',
button_attributes: {
'data-icon': 'gear'
}
});
So the question is, when I put this button in the header or footer, I want it display in any page. How do I set the page id for any page?