Skip to content

Commit 8cefec8

Browse files
committed
fix: Change inheritance to be strict compatible
Signed-off-by: Gordon Smith <[email protected]>
1 parent 921556f commit 8cefec8

21 files changed

+285
-285
lines changed

CellSelection.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ define([
128128
columnIds.push(id);
129129
}
130130
if (id === idFrom && (idFrom = columnIds) ||
131-
id === idTo && (idTo = columnIds)) {
131+
id === idTo && (idTo = columnIds)) {
132132
// Once found, mark it off so we don't hit it again
133133
columnIds.push(id);
134134
if (started || (idFrom == columnIds && id == idTo)) {
@@ -157,10 +157,10 @@ define([
157157
}
158158
},
159159

160-
_determineSelectionDirection: function () {
160+
_determineSelectionDirection: function _determineSelectionDirection() {
161161
// Extend Selection to return next/previousSibling instead of down/up,
162162
// given how CellSelection#_select is written
163-
var result = this.inherited(arguments);
163+
var result = this.inherited(_determineSelectionDirection, arguments);
164164
if (result === 'down') {
165165
return 'nextSibling';
166166
}
@@ -192,10 +192,10 @@ define([
192192
return this.allSelected && (!object.row.data || this.allowSelect(object));
193193
}
194194
},
195-
clearSelection: function (exceptId) {
195+
clearSelection: function clearSelection(exceptId) {
196196
// disable exceptId in cell selection, since it would require double parameters
197197
exceptId = false;
198-
this.inherited(arguments);
198+
this.inherited(clearSelection, arguments);
199199
}
200200
});
201201
});

ColumnSet.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ define([
191191
}
192192
},
193193

194-
postCreate: function () {
194+
postCreate: function postCreate() {
195195
var self = this;
196-
this.inherited(arguments);
196+
this.inherited(postCreate, arguments);
197197

198198
this.on(horizMouseWheel(this), horizMoveHandler);
199199
if (has('touch')) {
@@ -223,7 +223,7 @@ define([
223223

224224
columnSets: [],
225225

226-
createRowCells: function (tag, each, subRows, object, options) {
226+
createRowCells: function createRowCells(tag, each, subRows, object, options) {
227227
var row = domConstruct.create('table', { className: 'dgrid-row-table' });
228228
var tbody = domConstruct.create('tbody', null, row);
229229
var tr = domConstruct.create('tr', null, tbody);
@@ -237,30 +237,30 @@ define([
237237
}, cell);
238238
cell.setAttribute(colsetidAttr, i);
239239
var subset = getColumnSetSubRows(subRows || this.subRows, i) || this.columnSets[i];
240-
cell.appendChild(this.inherited(arguments, [tag, each, subset, object, options]));
240+
cell.appendChild(this.inherited(createRowCells, arguments, [tag, each, subset, object, options]));
241241
}
242242
return row;
243243
},
244244

245-
renderArray: function () {
246-
var rows = this.inherited(arguments);
245+
renderArray: function renderArray() {
246+
var rows = this.inherited(renderArray, arguments);
247247

248248
for (var i = 0; i < rows.length; i++) {
249249
adjustScrollLeft(this, rows[i]);
250250
}
251251
return rows;
252252
},
253253

254-
insertRow: function () {
255-
var row = this.inherited(arguments);
254+
insertRow: function insertRow() {
255+
var row = this.inherited(insertRow, arguments);
256256
adjustScrollLeft(this, row);
257257
return row;
258258
},
259259

260-
renderHeader: function () {
260+
renderHeader: function renderHeader() {
261261
// summary:
262262
// Setup the headers for the grid
263-
this.inherited(arguments);
263+
this.inherited(renderHeader, arguments);
264264

265265
var columnSets = this.columnSets,
266266
scrollers = this._columnSetScrollers,
@@ -310,7 +310,7 @@ define([
310310
return rule;
311311
},
312312

313-
configStructure: function () {
313+
configStructure: function configStructure() {
314314
// Squash the column sets together so the grid and other dgrid extensions and mixins can
315315
// configure the columns and create any needed subrows.
316316
this.columns = {};
@@ -321,7 +321,7 @@ define([
321321
columnSet[j] = this._configColumns(i + '-' + j + '-', columnSet[j]);
322322
}
323323
}
324-
this.inherited(arguments);
324+
this.inherited(configStructure, arguments);
325325
},
326326

327327
_positionScrollers: function () {
@@ -383,19 +383,19 @@ define([
383383

384384
if (this._columnSetScrollLefts[colSetId] !== scrollLeft) {
385385
query('.dgrid-column-set[' + colsetidAttr + '="' + colSetId +
386-
'"],.dgrid-column-set-scroller[' + colsetidAttr + '="' + colSetId + '"]', this.domNode
387-
).forEach(function (element, i) {
388-
element.scrollLeft = scrollLeft;
389-
if (!i) {
390-
// Compute newScrollLeft based on actual resulting
391-
// value of scrollLeft, which may be different than
392-
// what we assigned under certain circumstances
393-
// (e.g. Chrome under 33% / 67% / 90% zoom).
394-
// Only need to compute this once, as it will be the
395-
// same for every row.
396-
newScrollLeft = element.scrollLeft;
397-
}
398-
});
386+
'"],.dgrid-column-set-scroller[' + colsetidAttr + '="' + colSetId + '"]', this.domNode
387+
).forEach(function (element, i) {
388+
element.scrollLeft = scrollLeft;
389+
if (!i) {
390+
// Compute newScrollLeft based on actual resulting
391+
// value of scrollLeft, which may be different than
392+
// what we assigned under certain circumstances
393+
// (e.g. Chrome under 33% / 67% / 90% zoom).
394+
// Only need to compute this once, as it will be the
395+
// same for every row.
396+
newScrollLeft = element.scrollLeft;
397+
}
398+
});
399399
this._columnSetScrollLefts[colSetId] = newScrollLeft;
400400
}
401401
},

Editor.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ define([
2323
this._editorsPendingStartup = [];
2424
},
2525

26-
postCreate: function () {
26+
postCreate: function postCreate() {
2727
var self = this;
2828

29-
this.inherited(arguments);
29+
this.inherited(postCreate, arguments);
3030

3131
this.on('.dgrid-input:focusin', function () {
3232
self._focusedEditorCell = self.cell(this);
@@ -42,9 +42,9 @@ define([
4242
this._listeners.push(this._editorFocusoutHandle);
4343
},
4444

45-
insertRow: function () {
45+
insertRow: function insertRow() {
4646
this._editorRowListeners = {};
47-
var rowElement = this.inherited(arguments);
47+
var rowElement = this.inherited(insertRow, arguments);
4848
var row = this.row(rowElement);
4949
var rowListeners = this._editorCellListeners[rowElement.id] =
5050
this._editorCellListeners[rowElement.id] || {};
@@ -65,7 +65,7 @@ define([
6565
return rowElement;
6666
},
6767

68-
refresh: function () {
68+
refresh: function refresh() {
6969
for (var id in this._editorInstances) {
7070
var editorInstanceDomNode = this._getEditorRootNode(this._editorInstances[id].domNode);
7171
if (editorInstanceDomNode && editorInstanceDomNode.parentNode) {
@@ -75,7 +75,7 @@ define([
7575
}
7676
}
7777

78-
return this.inherited(arguments);
78+
return this.inherited(refresh, arguments);
7979
},
8080

8181
removeRow: function (rowElement) {
@@ -117,11 +117,11 @@ define([
117117
}
118118
}
119119

120-
return this.inherited(arguments);
120+
return this.inherited(removeRow, arguments);
121121
},
122122

123-
renderArray: function () {
124-
var rows = this.inherited(arguments);
123+
renderArray: function renderArray() {
124+
var rows = this.inherited(renderArray, arguments);
125125
if (rows.length) {
126126
// Finish processing any pending editors that are now displayed
127127
this._startupPendingEditors();
@@ -132,14 +132,14 @@ define([
132132
return rows;
133133
},
134134

135-
_onNotification: function () {
136-
this.inherited(arguments);
135+
_onNotification: function _onNotification() {
136+
this.inherited(_onNotification, arguments);
137137
this._startupPendingEditors();
138138
},
139139

140-
_destroyColumns: function () {
140+
_destroyColumns: function _destroyColumns() {
141141
this._editorStructureCleanup();
142-
this.inherited(arguments);
142+
this.inherited(_destroyColumns, arguments);
143143
},
144144

145145
_editorStructureCleanup: function () {
@@ -178,13 +178,13 @@ define([
178178
this._editorsPendingStartup = [];
179179
},
180180

181-
configStructure: function () {
181+
configStructure: function configStructure() {
182182
this._alwaysOnWidgetColumns = [];
183-
this.inherited(arguments);
183+
this.inherited(configStructure, arguments);
184184
},
185185

186-
_configColumns: function () {
187-
var columnArray = this.inherited(arguments);
186+
_configColumns: function _configColumns() {
187+
var columnArray = this.inherited(_configColumns, arguments);
188188
for (var i = 0, l = columnArray.length; i < l; i++) {
189189
if (columnArray[i].editor) {
190190
this._configureEditorColumn(columnArray[i]);
@@ -351,7 +351,7 @@ define([
351351
return null;
352352
},
353353

354-
refreshCell: function (cell) {
354+
refreshCell: function refreshCell(cell) {
355355
var column = cell.column;
356356
var value = column.get ? column.get(cell.row.data) : cell.row.data[column.field];
357357

@@ -382,7 +382,7 @@ define([
382382
column._editorBlurHandle.remove();
383383
}
384384

385-
return this.inherited(arguments);
385+
return this.inherited(refreshCell, arguments);
386386
},
387387

388388
_showEditor: function (cmp, column, cellElement, value) {
@@ -582,7 +582,7 @@ define([
582582
this._listeners.push(
583583
on(wrapperNode, 'blur', function () {
584584
if (!cmp._dgridIgnoreChange) {
585-
self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
585+
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });
586586
}
587587
})
588588
);
@@ -592,7 +592,7 @@ define([
592592
// the 'change' event is delayed by setTimeouts in Dijit and will fire too late.
593593
cmp.on('change', function () {
594594
if (!cmp._dgridIgnoreChange) {
595-
self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
595+
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });
596596
}
597597
});
598598
}
@@ -730,7 +730,7 @@ define([
730730
}
731731
}
732732

733-
self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
733+
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });
734734

735735
var parentNode = rootNode.parentNode,
736736
options = { alreadyHooked: true },

Grid.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ define([
103103
// summary:
104104
// Generates the grid for each row (used by renderHeader and and renderRow)
105105
var row = domConstruct.create('table', {
106-
className: 'dgrid-row-table',
107-
role: 'presentation'
108-
}),
106+
className: 'dgrid-row-table',
107+
role: 'presentation'
108+
}),
109109
// IE < 9 needs an explicit tbody; other browsers do not
110110
tbody = (has('ie') < 9) ? domConstruct.create('tbody', null, row) : row,
111111
tr,
@@ -284,7 +284,7 @@ define([
284284
this._sortListener = listen(row, 'click,keydown', function (event) {
285285
// respond to click, space keypress, or enter keypress
286286
if (event.type === 'click' || event.keyCode === 32 ||
287-
(!has('opera') && event.keyCode === 13)) {
287+
(!has('opera') && event.keyCode === 13)) {
288288
var target = event.target;
289289
var field;
290290
var sort;
@@ -333,14 +333,14 @@ define([
333333
});
334334
},
335335

336-
resize: function () {
336+
resize: function resize() {
337337
// extension of List.resize to allow accounting for
338338
// column sizes larger than actual grid area
339339
var headerTableNode = this.headerNode.firstChild,
340340
contentNode = this.contentNode,
341341
width;
342342

343-
this.inherited(arguments);
343+
this.inherited(resize, arguments);
344344

345345
// Force contentNode width to match up with header width.
346346
contentNode.style.width = ''; // reset first
@@ -353,22 +353,22 @@ define([
353353
}
354354
},
355355

356-
destroy: function () {
356+
destroy: function destroy() {
357357
// Run _destroyColumns first to perform any column plugin tear-down logic.
358358
this._destroyColumns();
359359
if (this._sortListener) {
360360
this._sortListener.remove();
361361
}
362362

363-
this.inherited(arguments);
363+
this.inherited(destroy, arguments);
364364
},
365365

366-
_setSort: function () {
366+
_setSort: function _setSort() {
367367
// summary:
368368
// Extension of List.js sort to update sort arrow in UI
369369

370370
// Normalize sort first via inherited logic, then update the sort arrow
371-
this.inherited(arguments);
371+
this.inherited(_setSort, arguments);
372372
this.updateSortArrow(this.sort);
373373
},
374374

GridFromHtml.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ define([
3838
}
3939

4040
var GridFromHtml = declare(Grid, {
41-
configStructure: function () {
41+
configStructure: function configStructure() {
4242
// summary:
4343
// Configure subRows based on HTML originally in srcNodeRef
4444
if (!this._checkedTrs) {
4545
this._checkedTrs = true;
4646
this.subRows = getSubRowsFromDom(this.srcNodeRef, this.subRows);
4747
}
48-
return this.inherited(arguments);
48+
return this.inherited(configStructure, arguments);
4949
},
5050

51-
create: function (params, srcNodeRef) {
51+
create: function create(params, srcNodeRef) {
5252
// We need to replace srcNodeRef, presumably a table, with a div.
5353
// (Otherwise we'll generate highly invalid markup, which IE doesn't like)
5454
var div = document.createElement('div'),
@@ -68,7 +68,7 @@ define([
6868
(params = params || {}).srcNodeRef = srcNodeRef;
6969
// call inherited with the new node
7070
// (but configStructure will look at srcNodeRef)
71-
this.inherited(arguments, [params, div]);
71+
this.inherited(create, arguments, [params, div]);
7272

7373
// destroy srcNodeRef for good now that we're done with it
7474
domConstruct.destroy(srcNodeRef);

0 commit comments

Comments
 (0)