mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-31 06:28:13 +02:00
Simplify comment highlight behavior in Pholio
Summary: - Currently, we register this behavior every time we load comments. Instead, register it once. - We have two very similar behaviors for over/out. Just use one that does the right thing based on the event type. Test Plan: Waved my mouse over areas of the image with reticles, saw the correct comments highlight. Reviewers: chad, ljalonen Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5082
This commit is contained in:
parent
11f6e73328
commit
a2abbd560a
2 changed files with 16 additions and 24 deletions
|
@ -1873,7 +1873,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-pholio-mock-view' =>
|
'javelin-behavior-pholio-mock-view' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/893b9f91/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
|
'uri' => '/res/e30e42ce/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -2551,7 +2551,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-application-launch-view-css' =>
|
'phabricator-application-launch-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/13c3d7f3/rsrc/css/application/base/phabricator-application-launch-view.css',
|
'uri' => '/res/8aee0702/rsrc/css/application/base/phabricator-application-launch-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -126,6 +126,20 @@ JX.behavior('pholio-mock-view', function(config) {
|
||||||
JX.$V(e)), startPos);
|
JX.$V(e)), startPos);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
JX.Stratcom.listen(
|
||||||
|
['mouseover', 'mouseout'],
|
||||||
|
'image_selection',
|
||||||
|
function(e) {
|
||||||
|
var data = e.getNodeData('image_selection');
|
||||||
|
var comment = JX.$(data.phid + "_comment");
|
||||||
|
var highlight = (e.getType() == 'mouseover');
|
||||||
|
|
||||||
|
JX.DOM.alterClass(
|
||||||
|
comment,
|
||||||
|
'pholio-mock-inline-comment-highlight',
|
||||||
|
highlight);
|
||||||
|
});
|
||||||
|
|
||||||
JX.Stratcom.listen(
|
JX.Stratcom.listen(
|
||||||
'mouseup',
|
'mouseup',
|
||||||
null,
|
null,
|
||||||
|
@ -208,28 +222,6 @@ JX.behavior('pholio-mock-view', function(config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JX.Stratcom.listen(
|
|
||||||
'mouseover',
|
|
||||||
'image_selection',
|
|
||||||
function(e) {
|
|
||||||
var data = e.getNodeData('image_selection');
|
|
||||||
|
|
||||||
var inline_comment = JX.$(data.phid + "_comment");
|
|
||||||
JX.DOM.alterClass(inline_comment,
|
|
||||||
'pholio-mock-inline-comment-highlight', true);
|
|
||||||
});
|
|
||||||
|
|
||||||
JX.Stratcom.listen(
|
|
||||||
'mouseout',
|
|
||||||
'image_selection',
|
|
||||||
function(e) {
|
|
||||||
var data = e.getNodeData('image_selection');
|
|
||||||
|
|
||||||
var inline_comment = JX.$(data.phid + "_comment");
|
|
||||||
JX.DOM.alterClass(inline_comment,
|
|
||||||
'pholio-mock-inline-comment-highlight', false);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
inline_comments.send();
|
inline_comments.send();
|
||||||
|
|
Loading…
Add table
Reference in a new issue