Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remarks #18

Merged
merged 6 commits into from Feb 14, 2018
Merged

Remarks #18

merged 6 commits into from Feb 14, 2018

Conversation

hixi
Copy link
Contributor

@hixi hixi commented Feb 13, 2018

This pull-request only makes sense if this one is accepted as well: mapsme/osm_conflate#13

  • Added a remarks-box
  • Added remarks extraction from props

Cleanup, which isn't directly related to the base functionality:

  • Use an explicit relative import

wereCoord = props['were_coords'];

wereCoord = props['were_coords'],
remarks = pop(props, 'remarks');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this wasn't clear to me, but this is not necessary at all. I'll update.

@@ -435,6 +447,11 @@ function displayPoint(data, audit) {
}
}

// render remarks, if any.
if (remarks) {
document.getElementById("remarks_box").innerHTML = "<h3>Remarks</h3><p>" + remarks + "</p>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shorter added segment is, the better. Also, this does not screen HTML in remarks. I'd suggest adding <b>Remarks:</b> <span id="remarks_content"></span> in the div, add $('#remarks_box').show(); $('#remarks_content').text(remarks) here, and $('#remarks_box').hide() below, when other UI elements are hidden.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this as well, thanks for your review and inputs!


wereCoord = props['were_coords'],
remarks = props['remarks'];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've added four spaces in this empty line. Could you remove them please?

$('#remarks_content').text(remarks);
} else {
$('#remarks_box').hide();
$('#remarks_content').text("");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to clear this <span>, since it is not visible.

Regarding the .hide(), please add it also to hidePoint() function below, and somewhere here.

@hixi
Copy link
Contributor Author

hixi commented Feb 13, 2018

Is this OK now? Let me know if I can ameliorate anything.

if (remarks) {
$('#remarks_box').show();
$('#remarks_content').text(remarks);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hidePoint() is not called when one feature replaces another, so you still have to add that else block here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that already taken care of by the line here? (default hidden, only shown if remarks are truthy): https://github.com/mapsme/cf_audit/pull/18/files#diff-c8d8df3d3735fa40f4df0b92c1776962R94

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the first object: that is the initialization code. After that, many displayPoint() are called in succession.

Copy link
Contributor Author

@hixi hixi Feb 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I understand the code a bit better, thank you :-)

@Zverik
Copy link
Contributor

Zverik commented Feb 13, 2018

I am at my day job currently, so don't be hasty, I can disappear for few hours :)

@hixi
Copy link
Contributor Author

hixi commented Feb 13, 2018

Didn't wanted to appear hasty, sorry to have given that impression ;-)

@Zverik Zverik merged commit d821c40 into mapsme:master Feb 14, 2018
@Zverik
Copy link
Contributor

Zverik commented Feb 14, 2018

Thanks, looks good now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants