Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js
index f63d6f5e1ccabcabf3bb37beaf90353a64bbdabb..fa08647874e3a4e76c105aeecf48a1776684d4cf 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js
@@ -27,129 +27,115 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/**
- * @constructor
- * @extends {WebInspector.DataGridNode}
- * @param {function(number, number)} callback
- * @param {number} startPosition
- * @param {number} endPosition
- * @param {number} chunkSize
+ * @unrestricted
*/
-WebInspector.ShowMoreDataGridNode = function(callback, startPosition, endPosition, chunkSize)
-{
- WebInspector.DataGridNode.call(this, {summaryRow:true}, false);
+WebInspector.ShowMoreDataGridNode = class extends WebInspector.DataGridNode {
+ /**
+ * @param {function(number, number)} callback
+ * @param {number} startPosition
+ * @param {number} endPosition
+ * @param {number} chunkSize
+ */
+ constructor(callback, startPosition, endPosition, chunkSize) {
+ super({summaryRow: true}, false);
this._callback = callback;
this._startPosition = startPosition;
this._endPosition = endPosition;
this._chunkSize = chunkSize;
- this.showNext = createElement("button");
- this.showNext.setAttribute("type", "button");
- this.showNext.addEventListener("click", this._showNextChunk.bind(this), false);
- this.showNext.textContent = WebInspector.UIString("Show %d before", this._chunkSize);
+ this.showNext = createElement('button');
+ this.showNext.setAttribute('type', 'button');
+ this.showNext.addEventListener('click', this._showNextChunk.bind(this), false);
+ this.showNext.textContent = WebInspector.UIString('Show %d before', this._chunkSize);
- this.showAll = createElement("button");
- this.showAll.setAttribute("type", "button");
- this.showAll.addEventListener("click", this._showAll.bind(this), false);
+ this.showAll = createElement('button');
+ this.showAll.setAttribute('type', 'button');
+ this.showAll.addEventListener('click', this._showAll.bind(this), false);
- this.showLast = createElement("button");
- this.showLast.setAttribute("type", "button");
- this.showLast.addEventListener("click", this._showLastChunk.bind(this), false);
- this.showLast.textContent = WebInspector.UIString("Show %d after", this._chunkSize);
+ this.showLast = createElement('button');
+ this.showLast.setAttribute('type', 'button');
+ this.showLast.addEventListener('click', this._showLastChunk.bind(this), false);
+ this.showLast.textContent = WebInspector.UIString('Show %d after', this._chunkSize);
this._updateLabels();
this.selectable = false;
-};
-
-WebInspector.ShowMoreDataGridNode.prototype = {
- _showNextChunk: function()
- {
- this._callback(this._startPosition, this._startPosition + this._chunkSize);
- },
-
- _showAll: function()
- {
- this._callback(this._startPosition, this._endPosition);
- },
-
- _showLastChunk: function()
- {
- this._callback(this._endPosition - this._chunkSize, this._endPosition);
- },
-
- _updateLabels: function()
- {
- var totalSize = this._endPosition - this._startPosition;
- if (totalSize > this._chunkSize) {
- this.showNext.classList.remove("hidden");
- this.showLast.classList.remove("hidden");
- } else {
- this.showNext.classList.add("hidden");
- this.showLast.classList.add("hidden");
- }
- this.showAll.textContent = WebInspector.UIString("Show all %d", totalSize);
- },
-
- /**
- * @override
- */
- createCells: function()
- {
- this._hasCells = false;
- WebInspector.DataGridNode.prototype.createCells.call(this);
- },
-
- /**
- * @override
- * @param {string} columnIdentifier
- * @return {!Element}
- */
- createCell: function(columnIdentifier)
- {
- var cell = this.createTD(columnIdentifier);
- if (!this._hasCells) {
- this._hasCells = true;
- if (this.depth)
- cell.style.setProperty("padding-left", (this.depth * this.dataGrid.indentWidth) + "px");
- cell.appendChild(this.showNext);
- cell.appendChild(this.showAll);
- cell.appendChild(this.showLast);
- }
- return cell;
- },
-
- /**
- * @param {number} from
- */
- setStartPosition: function(from)
- {
- this._startPosition = from;
- this._updateLabels();
- },
-
- /**
- * @param {number} to
- */
- setEndPosition: function(to)
- {
- this._endPosition = to;
- this._updateLabels();
- },
-
- /**
- * @override
- * @return {number}
- */
- nodeSelfHeight: function()
- {
- return 32;
- },
-
- dispose: function()
- {
- },
+ }
+
+ _showNextChunk() {
+ this._callback(this._startPosition, this._startPosition + this._chunkSize);
+ }
+
+ _showAll() {
+ this._callback(this._startPosition, this._endPosition);
+ }
+
+ _showLastChunk() {
+ this._callback(this._endPosition - this._chunkSize, this._endPosition);
+ }
+
+ _updateLabels() {
+ var totalSize = this._endPosition - this._startPosition;
+ if (totalSize > this._chunkSize) {
+ this.showNext.classList.remove('hidden');
+ this.showLast.classList.remove('hidden');
+ } else {
+ this.showNext.classList.add('hidden');
+ this.showLast.classList.add('hidden');
+ }
+ this.showAll.textContent = WebInspector.UIString('Show all %d', totalSize);
+ }
+
+ /**
+ * @override
+ */
+ createCells() {
+ this._hasCells = false;
+ super.createCells();
+ }
+
+ /**
+ * @override
+ * @param {string} columnIdentifier
+ * @return {!Element}
+ */
+ createCell(columnIdentifier) {
+ var cell = this.createTD(columnIdentifier);
+ if (!this._hasCells) {
+ this._hasCells = true;
+ if (this.depth)
+ cell.style.setProperty('padding-left', (this.depth * this.dataGrid.indentWidth) + 'px');
+ cell.appendChild(this.showNext);
+ cell.appendChild(this.showAll);
+ cell.appendChild(this.showLast);
+ }
+ return cell;
+ }
+
+ /**
+ * @param {number} from
+ */
+ setStartPosition(from) {
+ this._startPosition = from;
+ this._updateLabels();
+ }
- __proto__: WebInspector.DataGridNode.prototype
+ /**
+ * @param {number} to
+ */
+ setEndPosition(to) {
+ this._endPosition = to;
+ this._updateLabels();
+ }
+
+ /**
+ * @override
+ * @return {number}
+ */
+ nodeSelfHeight() {
+ return 32;
+ }
+
+ dispose() {
+ }
};
-

Powered by Google App Engine
This is Rietveld 408576698