As an example scenario, I'm using an AngularJS ng-repeat directive to render a number of taskbar "items". Right clicking on these taskbar items opens up the bootstrap contextmenu.
One of options within this menu is responsible for closing a module and removing the taskbar item from the dom. When this happens the context menu stays visible.
The
clearMenus()
function relies on the presence of the originally clicked dom element in order to close the menu.If the element is removed from the dom the
.open
class never gets removed and the menu remains visible.See this jsFiddle.
As an example scenario, I'm using an AngularJS
ng-repeat
directive to render a number of taskbar "items". Right clicking on these taskbar items opens up the bootstrap contextmenu.One of options within this menu is responsible for closing a module and removing the taskbar item from the dom. When this happens the context menu stays visible.