Show saved inline comments
Summary: Saved inline comments are now shown for images. Test Plan: Verified that inline comments are loaded and shown. Reviewers: epriestley CC: aran, Korvin Maniphest Tasks: T2446 Differential Revision: https://secure.phabricator.com/D4866
This commit is contained in:
committed by
epriestley
parent
7063ee638e
commit
bed728f23e
@@ -35,6 +35,7 @@ JX.behavior('pholio-mock-view', function(config) {
|
||||
main.src = data.fullSizeURI;
|
||||
|
||||
JX.DOM.setContent(wrapper,main);
|
||||
load_inline_comments();
|
||||
});
|
||||
|
||||
|
||||
@@ -123,7 +124,7 @@ JX.behavior('pholio-mock-view', function(config) {
|
||||
|
||||
selection_fill.title = comment;
|
||||
|
||||
var saveURL = "/pholio/inline/" + imageData['imageID'] + "/";
|
||||
var saveURL = "/pholio/inline/save/";
|
||||
|
||||
var inlineComment = new JX.Request(saveURL, function(r) {
|
||||
|
||||
@@ -144,6 +145,36 @@ JX.behavior('pholio-mock-view', function(config) {
|
||||
|
||||
});
|
||||
|
||||
function load_inline_comments() {
|
||||
var data = JX.Stratcom.getData(JX.$(config.mainID));
|
||||
|
||||
var inline_comments_url = "/pholio/inline/" + data['imageID'] + "/";
|
||||
var inline_comments = new JX.Request(inline_comments_url, function(r) {
|
||||
|
||||
if (r.length > 0) {
|
||||
for(i=0; i < r.length; i++) {
|
||||
var inlineSelection = JX.$N(
|
||||
'div',
|
||||
{
|
||||
id: r[i].phid,
|
||||
className: 'pholio-mock-select-border',
|
||||
title: r[i].content
|
||||
});
|
||||
|
||||
JX.DOM.appendContent(wrapper, inlineSelection);
|
||||
|
||||
JX.$V(r[i].x, r[i].y).setPos(inlineSelection);
|
||||
JX.$V(r[i].width, r[i].height)
|
||||
.setDim(inlineSelection);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
inline_comments.send();
|
||||
}
|
||||
|
||||
load_inline_comments();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user