mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-06 09:29:28 +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:
parent
742ee44960
commit
34b6c32d2e
2 changed files with 10 additions and 2 deletions
|
@ -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()
|
||||
)
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue