Skip to content

Commit

Permalink
Text Pager now follows the same pattern as Label for setting enableHT…
Browse files Browse the repository at this point in the history
…MLText
  • Loading branch information
Tom Walter committed Mar 13, 2017
1 parent 26a2d9f commit 6a4b770
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions static/script/widgets/textpager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ define(
* @constructor
* @ignore
*/
init: function(id) {
this._super(id, '');
init: function(id, enableHTML) {
this._super(id, '', enableHTML);
this.addClass('textpager');
this._page = 1;
},
Expand All @@ -36,15 +36,15 @@ define(
* @param {antie.devices.Device} device The device to render to.
* @returns A device-specific object that represents the widget as displayed on the device (in a browser, a DOMElement);
*/
render: function(device, enableHTML) {
render: function(device) {
var s = this._text;

if(!this.outputElement) {
this.outputElement = device.createContainer(this.id, this.getClasses());
this.innerElement = device.createContainer(this.id + '_inner');
this.outputElement.appendChild(this.innerElement);
}
device.setElementContent(this.innerElement, s, enableHTML);
device.setElementContent(this.innerElement, s, this._enableHTML);

return this.outputElement;
},
Expand Down Expand Up @@ -93,22 +93,6 @@ define(
setText: function(text) {
this._super(text);

// Remove the bottom padding to allow the page count to be
// recalculated.
if(this.innerElement) {
this.innerElement.style.paddingBottom = 0;
}
this._paddingFudge = false;
},
/**
* Sets the text displayed by this label. Supports HTML content.
* This function is highly vulnerable to code injection.
* @deprecated
* @param {String} text The new text to be displayed.
*/
unsafeSetHTMLText: function(text) {
this._super(text);

// Remove the bottom padding to allow the page count to be
// recalculated.
if(this.innerElement) {
Expand Down

0 comments on commit 6a4b770

Please sign in to comment.