-
Notifications
You must be signed in to change notification settings - Fork 31
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
sorted all menus #545
base: master
Are you sure you want to change the base?
sorted all menus #545
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,23 +288,17 @@ define(["underscore", "util"], function (_, util) { | |
) { | ||
if (this.hasFeatureMetadata) { | ||
this.fmTable.innerHTML = ""; | ||
var mdObj; | ||
if (tipOrInt === "tip") { | ||
mdObj = this.empress._tipMetadata; | ||
} else if (tipOrInt === "int") { | ||
mdObj = this.empress._intMetadata; | ||
} else { | ||
throw new Error("Invalid tipOrInt value: " + tipOrInt); | ||
} | ||
if (_.has(mdObj, nodeName)) { | ||
if (this.empress.hasFeatureMetadata(nodeName)) { | ||
var headerRow = this.fmTable.insertRow(-1); | ||
Comment on lines
-299
to
292
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like the modified code considers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, Assuming I am not looking over anything, I'll remove |
||
var featureRow = this.fmTable.insertRow(-1); | ||
for (var x = 0; x < this.fmCols.length; x++) { | ||
var colName = this.fmCols[x]; | ||
for (var col of this.fmCols) { | ||
var colCell = headerRow.insertCell(-1); | ||
colCell.innerHTML = "<strong>" + colName + "</strong>"; | ||
colCell.innerHTML = "<strong>" + col + "</strong>"; | ||
var dataCell = featureRow.insertCell(-1); | ||
dataCell.innerHTML = mdObj[nodeName][x]; | ||
dataCell.innerHTML = this.empress.getNodeFeatureMetadataValue( | ||
nodeName, | ||
col | ||
); | ||
} | ||
show(this.fmTable); | ||
hide(this.fmNoDataNote); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, should this ever happen in practice? At least in the context of
makeFeatureMetadataTable()
I don't think it should, since we've already calledEmpress.hasFeatureMetadata()
. I vote we throw an error here instead, unless I am missing something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can throw an error. I choose to return undefined in case the calling function wants to do something special in situations where no metadata exists (which I guess can also be handled by a try catch block).