Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions js_src/pid_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
goog.provide('app.MessageStructure');

goog.require('goog.dom');
goog.require('goog.html.sanitizer.HtmlSanitizer');
goog.require('goog.ui.Component');
goog.require('goog.ui.Tooltip');

Expand Down Expand Up @@ -88,9 +89,8 @@ app.MessageField.prototype.createDom = function() {
app.MessageField.prototype.enterDocument = function() {
app.MessageField.superClass_.enterDocument.call(this);

var tt = (
Copy link
Member Author

Choose a reason for hiding this comment

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

I always thought this was an object at first glance, so I changed it to make it more clear that it's a string.

Copy link
Member

Choose a reason for hiding this comment

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

I wondered if that was a linter fix, but perhaps not looking at the blame.

'Type: ' + this._field_info['type'] + '<br>' +
'Name: ' + this._field_info['name'] + '<br>');
var tt = 'Type: ' + this._field_info['type'] + '<br>' +
'Name: ' + this._field_info['name'] + '<br>';

if (this._field_info['multiplier'] != undefined) {
tt += 'Multipler: 10<sup>' + this._field_info['multiplier'] + '</sup><br>';
Expand All @@ -113,13 +113,15 @@ app.MessageField.prototype.enterDocument = function() {
tt += 'Labeled Values: <ul>';
var enums = this._field_info['enums'];
for (var i = 0; i < enums.length; ++i) {
tt += '<li>' + enums[i]['value'] + ': ' + enums[i]['label'] + '</li/>';
tt += '<li>' + enums[i]['value'] + ': ' + enums[i]['label'] + '</li>';
}
tt += '</ul>';
}

var sanitizer = new goog.html.sanitizer.HtmlSanitizer.Builder().build();

this.tt = new goog.ui.Tooltip(this.getElement());
this.tt.setHtml(tt);
this.tt.setSafeHtml(sanitizer.sanitize(tt));
};


Expand Down Expand Up @@ -231,7 +233,7 @@ app.MessageGroup.prototype.attachTooltip = function(field) {
} else if (max != undefined) {
tt += 'This group repeats at most ' + max + ' times.';
}
this.tt.setHtml(tt);
this.tt.setText(tt);
};


Expand Down
Loading