Skip to content
Open
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
10 changes: 5 additions & 5 deletions CellSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ define([
columnIds.push(id);
}
if (id === idFrom && (idFrom = columnIds) ||
id === idTo && (idTo = columnIds)) {
id === idTo && (idTo = columnIds)) {
// Once found, mark it off so we don't hit it again
columnIds.push(id);
if (started || (idFrom == columnIds && id == idTo)) {
Expand Down Expand Up @@ -157,10 +157,10 @@ define([
}
},

_determineSelectionDirection: function () {
_determineSelectionDirection: function _determineSelectionDirection() {
// Extend Selection to return next/previousSibling instead of down/up,
// given how CellSelection#_select is written
var result = this.inherited(arguments);
var result = this.inherited(_determineSelectionDirection, arguments);
if (result === 'down') {
return 'nextSibling';
}
Expand Down Expand Up @@ -192,10 +192,10 @@ define([
return this.allSelected && (!object.row.data || this.allowSelect(object));
}
},
clearSelection: function (exceptId) {
clearSelection: function clearSelection(exceptId) {
// disable exceptId in cell selection, since it would require double parameters
exceptId = false;
this.inherited(arguments);
this.inherited(clearSelection, arguments);
}
});
});
50 changes: 25 additions & 25 deletions ColumnSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ define([
}
},

postCreate: function () {
postCreate: function postCreate() {
var self = this;
this.inherited(arguments);
this.inherited(postCreate, arguments);

this.on(horizMouseWheel(this), horizMoveHandler);
if (has('touch')) {
Expand Down Expand Up @@ -223,7 +223,7 @@ define([

columnSets: [],

createRowCells: function (tag, each, subRows, object, options) {
createRowCells: function createRowCells(tag, each, subRows, object, options) {
var row = domConstruct.create('table', { className: 'dgrid-row-table' });
var tbody = domConstruct.create('tbody', null, row);
var tr = domConstruct.create('tr', null, tbody);
Expand All @@ -237,30 +237,30 @@ define([
}, cell);
cell.setAttribute(colsetidAttr, i);
var subset = getColumnSetSubRows(subRows || this.subRows, i) || this.columnSets[i];
cell.appendChild(this.inherited(arguments, [tag, each, subset, object, options]));
cell.appendChild(this.inherited(createRowCells, arguments, [tag, each, subset, object, options]));
}
return row;
},

renderArray: function () {
var rows = this.inherited(arguments);
renderArray: function renderArray() {
var rows = this.inherited(renderArray, arguments);

for (var i = 0; i < rows.length; i++) {
adjustScrollLeft(this, rows[i]);
}
return rows;
},

insertRow: function () {
var row = this.inherited(arguments);
insertRow: function insertRow() {
var row = this.inherited(insertRow, arguments);
adjustScrollLeft(this, row);
return row;
},

renderHeader: function () {
renderHeader: function renderHeader() {
// summary:
// Setup the headers for the grid
this.inherited(arguments);
this.inherited(renderHeader, arguments);

var columnSets = this.columnSets,
scrollers = this._columnSetScrollers,
Expand Down Expand Up @@ -310,7 +310,7 @@ define([
return rule;
},

configStructure: function () {
configStructure: function configStructure() {
// Squash the column sets together so the grid and other dgrid extensions and mixins can
// configure the columns and create any needed subrows.
this.columns = {};
Expand All @@ -321,7 +321,7 @@ define([
columnSet[j] = this._configColumns(i + '-' + j + '-', columnSet[j]);
}
}
this.inherited(arguments);
this.inherited(configStructure, arguments);
},

_positionScrollers: function () {
Expand Down Expand Up @@ -383,19 +383,19 @@ define([

if (this._columnSetScrollLefts[colSetId] !== scrollLeft) {
query('.dgrid-column-set[' + colsetidAttr + '="' + colSetId +
'"],.dgrid-column-set-scroller[' + colsetidAttr + '="' + colSetId + '"]', this.domNode
).forEach(function (element, i) {
element.scrollLeft = scrollLeft;
if (!i) {
// Compute newScrollLeft based on actual resulting
// value of scrollLeft, which may be different than
// what we assigned under certain circumstances
// (e.g. Chrome under 33% / 67% / 90% zoom).
// Only need to compute this once, as it will be the
// same for every row.
newScrollLeft = element.scrollLeft;
}
});
'"],.dgrid-column-set-scroller[' + colsetidAttr + '="' + colSetId + '"]', this.domNode
).forEach(function (element, i) {
element.scrollLeft = scrollLeft;
if (!i) {
// Compute newScrollLeft based on actual resulting
// value of scrollLeft, which may be different than
// what we assigned under certain circumstances
// (e.g. Chrome under 33% / 67% / 90% zoom).
// Only need to compute this once, as it will be the
// same for every row.
newScrollLeft = element.scrollLeft;
}
});
this._columnSetScrollLefts[colSetId] = newScrollLeft;
}
},
Expand Down
44 changes: 22 additions & 22 deletions Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ define([
this._editorsPendingStartup = [];
},

postCreate: function () {
postCreate: function postCreate() {
var self = this;

this.inherited(arguments);
this.inherited(postCreate, arguments);

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

insertRow: function () {
insertRow: function insertRow() {
this._editorRowListeners = {};
var rowElement = this.inherited(arguments);
var rowElement = this.inherited(insertRow, arguments);
var row = this.row(rowElement);
var rowListeners = this._editorCellListeners[rowElement.id] =
this._editorCellListeners[rowElement.id] || {};
Expand All @@ -65,7 +65,7 @@ define([
return rowElement;
},

refresh: function () {
refresh: function refresh() {
for (var id in this._editorInstances) {
var editorInstanceDomNode = this._getEditorRootNode(this._editorInstances[id].domNode);
if (editorInstanceDomNode && editorInstanceDomNode.parentNode) {
Expand All @@ -75,7 +75,7 @@ define([
}
}

return this.inherited(arguments);
return this.inherited(refresh, arguments);
},

removeRow: function (rowElement) {
Expand Down Expand Up @@ -117,11 +117,11 @@ define([
}
}

return this.inherited(arguments);
return this.inherited(removeRow, arguments);
},

renderArray: function () {
var rows = this.inherited(arguments);
renderArray: function renderArray() {
var rows = this.inherited(renderArray, arguments);
if (rows.length) {
// Finish processing any pending editors that are now displayed
this._startupPendingEditors();
Expand All @@ -132,14 +132,14 @@ define([
return rows;
},

_onNotification: function () {
this.inherited(arguments);
_onNotification: function _onNotification() {
this.inherited(_onNotification, arguments);
this._startupPendingEditors();
},

_destroyColumns: function () {
_destroyColumns: function _destroyColumns() {
this._editorStructureCleanup();
this.inherited(arguments);
this.inherited(_destroyColumns, arguments);
},

_editorStructureCleanup: function () {
Expand Down Expand Up @@ -178,13 +178,13 @@ define([
this._editorsPendingStartup = [];
},

configStructure: function () {
configStructure: function configStructure() {
this._alwaysOnWidgetColumns = [];
this.inherited(arguments);
this.inherited(configStructure, arguments);
},

_configColumns: function () {
var columnArray = this.inherited(arguments);
_configColumns: function _configColumns() {
var columnArray = this.inherited(_configColumns, arguments);
for (var i = 0, l = columnArray.length; i < l; i++) {
if (columnArray[i].editor) {
this._configureEditorColumn(columnArray[i]);
Expand Down Expand Up @@ -351,7 +351,7 @@ define([
return null;
},

refreshCell: function (cell) {
refreshCell: function refreshCell(cell) {
var column = cell.column;
var value = column.get ? column.get(cell.row.data) : cell.row.data[column.field];

Expand Down Expand Up @@ -382,7 +382,7 @@ define([
column._editorBlurHandle.remove();
}

return this.inherited(arguments);
return this.inherited(refreshCell, arguments);
},

_showEditor: function (cmp, column, cellElement, value) {
Expand Down Expand Up @@ -582,7 +582,7 @@ define([
this._listeners.push(
on(wrapperNode, 'blur', function () {
if (!cmp._dgridIgnoreChange) {
self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });
}
})
);
Expand All @@ -592,7 +592,7 @@ define([
// the 'change' event is delayed by setTimeouts in Dijit and will fire too late.
cmp.on('change', function () {
if (!cmp._dgridIgnoreChange) {
self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });
}
});
}
Expand Down Expand Up @@ -730,7 +730,7 @@ define([
}
}

self._updatePropertyFromEditor(column, cmp, {type: 'widget'});
self._updatePropertyFromEditor(column, cmp, { type: 'widget' });

var parentNode = rootNode.parentNode,
options = { alreadyHooked: true },
Expand Down
20 changes: 10 additions & 10 deletions Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ define([
// summary:
// Generates the grid for each row (used by renderHeader and and renderRow)
var row = domConstruct.create('table', {
className: 'dgrid-row-table',
role: 'presentation'
}),
className: 'dgrid-row-table',
role: 'presentation'
}),
// IE < 9 needs an explicit tbody; other browsers do not
tbody = (has('ie') < 9) ? domConstruct.create('tbody', null, row) : row,
tr,
Expand Down Expand Up @@ -284,7 +284,7 @@ define([
this._sortListener = listen(row, 'click,keydown', function (event) {
// respond to click, space keypress, or enter keypress
if (event.type === 'click' || event.keyCode === 32 ||
(!has('opera') && event.keyCode === 13)) {
(!has('opera') && event.keyCode === 13)) {
var target = event.target;
var field;
var sort;
Expand Down Expand Up @@ -333,14 +333,14 @@ define([
});
},

resize: function () {
resize: function resize() {
// extension of List.resize to allow accounting for
// column sizes larger than actual grid area
var headerTableNode = this.headerNode.firstChild,
contentNode = this.contentNode,
width;

this.inherited(arguments);
this.inherited(resize, arguments);

// Force contentNode width to match up with header width.
contentNode.style.width = ''; // reset first
Expand All @@ -353,22 +353,22 @@ define([
}
},

destroy: function () {
destroy: function destroy() {
// Run _destroyColumns first to perform any column plugin tear-down logic.
this._destroyColumns();
if (this._sortListener) {
this._sortListener.remove();
}

this.inherited(arguments);
this.inherited(destroy, arguments);
},

_setSort: function () {
_setSort: function _setSort() {
// summary:
// Extension of List.js sort to update sort arrow in UI

// Normalize sort first via inherited logic, then update the sort arrow
this.inherited(arguments);
this.inherited(_setSort, arguments);
this.updateSortArrow(this.sort);
},

Expand Down
8 changes: 4 additions & 4 deletions GridFromHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ define([
}

var GridFromHtml = declare(Grid, {
configStructure: function () {
configStructure: function configStructure() {
// summary:
// Configure subRows based on HTML originally in srcNodeRef
if (!this._checkedTrs) {
this._checkedTrs = true;
this.subRows = getSubRowsFromDom(this.srcNodeRef, this.subRows);
}
return this.inherited(arguments);
return this.inherited(configStructure, arguments);
},

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

// destroy srcNodeRef for good now that we're done with it
domConstruct.destroy(srcNodeRef);
Expand Down
Loading