mozilla-b2g/gaia — pull request #8641 by gasolin (2013-03-14 07:33:26+00:00)
Title: Issue 838040

Change to new approach to avoid the browser.param and also solved Homescreen button showing problem.

Approach (thanks advice from TimDream):

Since 'showBookmarkMenu' is bind to bookmark page, I add 'showBookmarkTabMenu' function to handle contextmenu in bookmark tab,
and move actual menu-showing function to a new 'showMenu' function.

'showMenu' function come with 2 param:

with 'url' param, showBookmarkMenu & showBookmarkTabMenu can pass correspondent url to 'showMenu' function.

with 'from' param, showMenu can customize the item to show in ActionMenu.

In showMenu, append bookmarkMenuRemove.dataset.url params to the button.

So in 'removeBookmark' function. we can process url from button dataset instead of parsing 'this.currentTab.url'.