1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-06 01:19:24 +01:00

fix conpherence menu selection

Summary: i think the DOM changed in conpherence with the menu upgrades. just noticed that when you select a new conpherence the old one is not de-selected. this fixes it by updating the javascript to ascend one node higher and then use DOM.scry with the right data sigil to get the nodes

Test Plan: read some messages, noted only the one I was reading had the entry highlighted in the left.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2399

Differential Revision: https://secure.phabricator.com/D4819
This commit is contained in:
Bob Trahan 2013-02-05 11:58:19 -08:00
parent 742ee44960
commit 34b6c32d2e
2 changed files with 10 additions and 2 deletions

View file

@ -206,6 +206,7 @@ abstract class ConpherenceController extends PhabricatorController {
'messages' => 'conpherence-messages',
'widgets_pane' => 'conpherence-widget-pane',
'form_pane' => 'conpherence-form',
'menu_pane' => 'conpherence-menu',
'fancy_ajax' => (bool) $this->getSelectedConpherencePHID()
)
);

View file

@ -19,14 +19,21 @@ JX.behavior('conpherence-menu', function(config) {
var messagesRoot = JX.$(config.messages);
var formRoot = JX.$(config.form_pane);
var widgetsRoot = JX.$(config.widgets_pane);
var menuRoot = JX.$(config.menu_pane);
JX.DOM.setContent(headerRoot, header);
JX.DOM.setContent(messagesRoot, messages);
messagesRoot.scrollTop = messagesRoot.scrollHeight;
JX.DOM.setContent(formRoot, form);
JX.DOM.setContent(widgetsRoot, widgets);
for (var i = 0; i < context.parentNode.childNodes.length; i++) {
var current = context.parentNode.childNodes[i];
var conpherences = JX.DOM.scry(
menuRoot,
'a',
'conpherence-menu-click'
);
for (var i = 0; i < conpherences.length; i++) {
var current = conpherences[i];
if (current.id == context.id) {
JX.DOM.alterClass(current, 'conpherence-selected', true);
JX.DOM.alterClass(current, 'hide-unread-count', true);