Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | JX.Stratcom.listen( | ||||
function(e) { | function(e) { | ||||
if (!e.getNode('phabricator-notification-menu')) { | if (!e.getNode('phabricator-notification-menu')) { | ||||
// Click outside the dropdown; hide it. | // Click outside the dropdown; hide it. | ||||
set_visible(null); | set_visible(null); | ||||
return; | return; | ||||
} | } | ||||
if (e.getNode('tag:a')) { | if (e.getNode('tag:a')) { | ||||
// User clicked a link, just follow the link. | // User clicked a link. Hide the menu, then follow the link. | ||||
set_visible(null); | |||||
return; | return; | ||||
} | } | ||||
if (!e.getNode('notification')) { | if (!e.getNode('notification')) { | ||||
// User clicked somewhere in the dead area of the menu, like the header | // User clicked somewhere in the dead area of the menu, like the header | ||||
// or footer. | // or footer. | ||||
return; | return; | ||||
} | } | ||||
// If the user clicked a notification (but missed a link) and it has a | // If the user clicked a notification (but missed a link) and it has a | ||||
// primary URI, go there. | // primary URI, go there. | ||||
var href = e.getNodeData('notification').href; | var href = e.getNodeData('notification').href; | ||||
if (href) { | if (href) { | ||||
JX.$U(href).go(); | JX.$U(href).go(); | ||||
e.kill(); | e.kill(); | ||||
set_visible(null); | |||||
} | } | ||||
}); | }); | ||||
JX.DOM.listen( | JX.DOM.listen( | ||||
bubble, | bubble, | ||||
'click', | 'click', | ||||
null, | null, | ||||
function(e) { | function(e) { | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |