1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Various highlights

Summary:
Highlight thumb for image user is currently viewing.
Highlight selection when user mouseovers it's inline(on side).

Test Plan: {F33990}

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2446

Differential Revision: https://secure.phabricator.com/D5134
This commit is contained in:
Lauri-Henrik Jalonen 2013-02-27 10:45:51 -08:00 committed by epriestley
parent ff1a679709
commit 5d30b1b4fb
4 changed files with 36 additions and 3 deletions

View file

@ -85,7 +85,11 @@ final class PholioInlineCommentView extends AphrontView {
'div', 'div',
array( array(
'id' => $this->inlineComment->getPHID()."_comment", 'id' => $this->inlineComment->getPHID()."_comment",
'class' => 'pholio-inline-comment' 'class' => 'pholio-inline-comment',
'sigil' => 'inline_comment',
'meta' => array(
'phid' => $this->inlineComment->getPHID()
)
), ),
array($comment_header, $comment_body)); array($comment_header, $comment_body));

View file

@ -108,6 +108,7 @@ final class PholioMockImagesView extends AphrontView {
$mockview[] = phutil_tag( $mockview[] = phutil_tag(
'div', 'div',
array( array(
'id' => 'pholio-mock-carousel',
'class' => 'pholio-mock-carousel', 'class' => 'pholio-mock-carousel',
), ),
$thumbnails); $thumbnails);

View file

@ -27,7 +27,8 @@
position: relative; position: relative;
} }
.device-desktop .pholio-mock-carousel-thumb-item:hover { .device-desktop .pholio-mock-carousel-thumb-item:hover,
.pholio-mock-carousel-thumb-current {
background: #383838; background: #383838;
border-color: #686868; border-color: #686868;
} }
@ -101,4 +102,3 @@
font-weight: normal; font-weight: normal;
margin-left: 5px; margin-left: 5px;
} }

View file

@ -87,6 +87,20 @@ JX.behavior('pholio-mock-view', function(config) {
img.onload = JX.bind(img, onload_image, active_image.id); img.onload = JX.bind(img, onload_image, active_image.id);
img.src = active_image.fullURI; img.src = active_image.fullURI;
var thumbs = JX.DOM.scry(
JX.$('pholio-mock-carousel'),
'div',
'mock-thumbnail');
for(var k in thumbs) {
var thumb_meta = JX.Stratcom.getData(thumbs[k]);
JX.DOM.alterClass(
thumbs[k],
'pholio-mock-carousel-thumb-current',
(active_image.id == thumb_meta.imageID));
}
load_inline_comments(); load_inline_comments();
} }
@ -142,6 +156,20 @@ JX.behavior('pholio-mock-view', function(config) {
highlight); highlight);
}); });
JX.Stratcom.listen(
['mouseover', 'mouseout'],
'inline_comment',
function(e) {
var data = e.getNodeData('inline_comment');
var selection = JX.$(data.phid + "_selection");
var highlight = (e.getType() == 'mouseover');
JX.DOM.alterClass(
selection,
'pholio-mock-inline-comment-highlight',
highlight);
});
JX.Stratcom.listen( JX.Stratcom.listen(
'mouseup', 'mouseup',
null, null,