diff --git a/CellSelection.js b/CellSelection.js index 0e6648860..854f3e65a 100644 --- a/CellSelection.js +++ b/CellSelection.js @@ -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)) { @@ -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'; } @@ -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); } }); }); diff --git a/ColumnSet.js b/ColumnSet.js index 8ab2d36e3..fa6b94ba1 100644 --- a/ColumnSet.js +++ b/ColumnSet.js @@ -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')) { @@ -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); @@ -237,13 +237,13 @@ 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]); @@ -251,16 +251,16 @@ define([ 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, @@ -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 = {}; @@ -321,7 +321,7 @@ define([ columnSet[j] = this._configColumns(i + '-' + j + '-', columnSet[j]); } } - this.inherited(arguments); + this.inherited(configStructure, arguments); }, _positionScrollers: function () { @@ -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; } }, diff --git a/Editor.js b/Editor.js index bfc0f535b..418b9d315 100644 --- a/Editor.js +++ b/Editor.js @@ -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); @@ -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] || {}; @@ -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) { @@ -75,7 +75,7 @@ define([ } } - return this.inherited(arguments); + return this.inherited(refresh, arguments); }, removeRow: function (rowElement) { @@ -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(); @@ -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 () { @@ -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]); @@ -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]; @@ -382,7 +382,7 @@ define([ column._editorBlurHandle.remove(); } - return this.inherited(arguments); + return this.inherited(refreshCell, arguments); }, _showEditor: function (cmp, column, cellElement, value) { @@ -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' }); } }) ); @@ -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' }); } }); } @@ -730,7 +730,7 @@ define([ } } - self._updatePropertyFromEditor(column, cmp, {type: 'widget'}); + self._updatePropertyFromEditor(column, cmp, { type: 'widget' }); var parentNode = rootNode.parentNode, options = { alreadyHooked: true }, diff --git a/Grid.js b/Grid.js index 4f7775bb4..0ff9bdc4f 100644 --- a/Grid.js +++ b/Grid.js @@ -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, @@ -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; @@ -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 @@ -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); }, diff --git a/GridFromHtml.js b/GridFromHtml.js index c0aba655a..f61125250 100644 --- a/GridFromHtml.js +++ b/GridFromHtml.js @@ -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'), @@ -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); diff --git a/GridWithColumnSetsFromHtml.js b/GridWithColumnSetsFromHtml.js index f3ca15d56..4053e9622 100644 --- a/GridWithColumnSetsFromHtml.js +++ b/GridWithColumnSetsFromHtml.js @@ -106,7 +106,7 @@ define([ return columnsets; } return declare([GridFromHtml, ColumnSet], { - configStructure: function () { + configStructure: function configStructure() { // summary: // Configure subRows based on HTML originally in srcNodeRef @@ -119,10 +119,10 @@ define([ } else { // no reason to worry about ColumnSets, let GridFromHtml do the job - return this.inherited(arguments); + return this.inherited(configStructure, arguments); } } - return this.inherited(arguments); + return this.inherited(configStructure, arguments); } }); }); \ No newline at end of file diff --git a/Keyboard.js b/Keyboard.js index f2814c4f7..12d86fb5f 100644 --- a/Keyboard.js +++ b/Keyboard.js @@ -10,10 +10,10 @@ define([ ], function (declare, aspect, domClass, on, lang, has, miscUtil) { var delegatingInputTypes = { - checkbox: 1, - radio: 1, - button: 1 - }, + checkbox: 1, + radio: 1, + button: 1 + }, hasGridCellClass = /\bdgrid-cell\b/, hasGridRowClass = /\bdgrid-row\b/; @@ -41,8 +41,8 @@ define([ // Event type to use for Keyboard's mouse down listener that sets focus. mouseDownEventType: 'mousedown', - postMixInProperties: function () { - this.inherited(arguments); + postMixInProperties: function postMixInProperties() { + this.inherited(postMixInProperties, arguments); if (!this.keyMap) { this.keyMap = lang.mixin({}, Keyboard.defaultKeyMap); @@ -52,8 +52,8 @@ define([ } }, - postCreate: function () { - this.inherited(arguments); + postCreate: function postCreate() { + this.inherited(postCreate, arguments); var grid = this; function handledEvent(event) { @@ -179,18 +179,18 @@ define([ this._debouncedEnsureScroll = miscUtil.debounce(this._ensureScroll, this); }, - _pruneRow: function () { + _pruneRow: function _pruneRow() { // If rows are being pruned for scrolling, then don't try to restore focus. var savedFocusedNode = this._focusedNode; this._focusedNode = null; - this.inherited(arguments); + this.inherited(_pruneRow, arguments); this._focusedNode = savedFocusedNode; }, - removeRow: function (rowElement) { + removeRow: function removeRow(rowElement) { if (!this._focusedNode) { // Nothing special to do if we have no record of anything focused - return this.inherited(arguments); + return this.inherited(removeRow, arguments); } var self = this, @@ -233,11 +233,11 @@ define([ this._focusedNode = null; } - this.inherited(arguments); + this.inherited(removeRow, arguments); }, - insertRow: function () { - var rowElement = this.inherited(arguments); + insertRow: function insertRow() { + var rowElement = this.inherited(insertRow, arguments); if (this._removedFocus && !this._removedFocus.wait) { this._restoreFocus(rowElement); } diff --git a/List.js b/List.js index d7d687828..0b5c62b17 100644 --- a/List.js +++ b/List.js @@ -271,7 +271,7 @@ define([ } // re-fire, since browsers are not consistent about propagation here event.stopPropagation(); - listen.emit(domNode, 'scroll', {scrollTarget: bodyNode}); + listen.emit(domNode, 'scroll', { scrollTarget: bodyNode }); }); this.configStructure(); this.renderHeader(); @@ -297,7 +297,7 @@ define([ postCreate: function () { }, - startup: function () { + startup: function startup() { // summary: // Called automatically after postCreate if the component is already // visible; otherwise, should be called manually once placed. @@ -305,7 +305,7 @@ define([ if (this._started) { return; } - this.inherited(arguments); + this.inherited(startup, arguments); this._started = true; this.resize(); // apply sort (and refresh) now that we're ready to render @@ -476,7 +476,7 @@ define([ // Insert the document fragment into the appropriate position container = beforeNode ? beforeNode.parentNode : self.contentNode; if (container && container.parentNode && - (container !== self.contentNode || len)) { + (container !== self.contentNode || len)) { container.insertBefore(rowsFragment, beforeNode || null); if (len) { self.adjustRowIndices(rows[len - 1]); @@ -489,7 +489,7 @@ define([ renderHeader: function () { // no-op in a plain list }, - setRowIndex: function(row, rowIndex, oldRowIndex) { + setRowIndex: function (row, rowIndex, oldRowIndex) { // Update row for changes to the visual row index. row.rowIndex = rowIndex; if (this.maintainOddEven) { @@ -513,7 +513,7 @@ define([ // (This is used by tree to allow the same object to appear under // multiple parents.) var id = this.id + '-row-' + ((this.collection && this.collection.getIdentity) ? - this.collection.getIdentity(object) : this._autoRowId++), + this.collection.getIdentity(object) : this._autoRowId++), row = byId(id, this.domNode), previousRow = row && row.previousSibling; @@ -594,7 +594,7 @@ define([ return new this._Row(rowId.substring(this.id.length + 5), object, target); } target = target.parentNode; - }while (target && target !== this.domNode); + } while (target && target !== this.domNode); return; } @@ -646,7 +646,7 @@ define([ break; } } - }while (steps); + } while (steps); // Return the final element we arrived at, which might still be the // starting element if we couldn't navigate further in that direction. return element; @@ -798,7 +798,7 @@ define([ // specifies whether to sort ascending (false) or descending (true) this.sort = typeof property !== 'string' ? property : - [{property: property, descending: descending}]; + [{ property: property, descending: descending }]; this._applySort(); }, diff --git a/OnDemandList.js b/OnDemandList.js index 118073b7d..dc62babf0 100644 --- a/OnDemandList.js +++ b/OnDemandList.js @@ -93,8 +93,8 @@ define([ // List of DOM nodes queued for deletion. _deleteQueue: [], - postCreate: function () { - this.inherited(arguments); + postCreate: function postCreate() { + this.inherited(postCreate, arguments); var self = this; // check visibility on scroll events on(this.bodyNode, 'scroll', @@ -168,8 +168,8 @@ define([ self._insertPreload(topPreload); var loadingNode = domConstruct.create('div', { - className: 'dgrid-loading' - }, preloadNode, 'before'), + className: 'dgrid-loading' + }, preloadNode, 'before'), innerNode = domConstruct.create('div', { className: 'dgrid-below' }, loadingNode); @@ -269,7 +269,7 @@ define([ preload.previous = newBottomPreload; }, - refresh: function (options) { + refresh: function refresh(options) { // summary: // Refreshes the contents of the grid. // options: Object? @@ -292,7 +292,7 @@ define([ this._previousScrollPosition = this.getScrollPosition(); } - this.inherited(arguments); + this.inherited(refresh, arguments); if (this._renderedCollection) { // render the query // renderQuery calls _trackError internally @@ -318,18 +318,18 @@ define([ } }, - resize: function () { - this.inherited(arguments); + resize: function resize() { + this.inherited(resize, arguments); this._processScroll(); }, - cleanup: function () { - this.inherited(arguments); + cleanup: function cleanup() { + this.inherited(cleanup, arguments); this.preload = null; }, - renderQueryResults: function (results) { - var rows = this.inherited(arguments); + renderQueryResults: function renderQueryResults(results) { + var rows = this.inherited(renderQueryResults, arguments); var collection = this._getRenderedCollection(this.preload); if (collection && collection.releaseRange) { @@ -404,7 +404,7 @@ define([ } while (preload) { if (!preload.rowHeight) { - preload.rowHeight = + preload.rowHeight = this._calcAverageRowHeight(preload.node.parentNode.querySelectorAll('.dgrid-row')); this._adjustPreloadHeight(preload); } @@ -620,7 +620,7 @@ define([ else { // the preload node is visible, or close to visible, better show it var offset = ((preloadNode.top ? visibleTop - requestBuffer : - visibleBottom) - preloadTop) / preload.rowHeight; + visibleBottom) - preloadTop) / preload.rowHeight; var count = (visibleBottom - visibleTop + 2 * requestBuffer) / preload.rowHeight; // utilize momentum for predictions var momentum = Math.max( diff --git a/Selection.js b/Selection.js index 340676b00..fe67df006 100644 --- a/Selection.js +++ b/Selection.js @@ -151,12 +151,12 @@ define([ // overridden in CellSelection _selectionTargetType: 'rows', - create: function () { + create: function create() { this.selection = {}; - return this.inherited(arguments); + return this.inherited(create, arguments); }, - postCreate: function () { - this.inherited(arguments); + postCreate: function postCreate() { + this.inherited(postCreate, arguments); this._initSelectionEvents(); @@ -166,8 +166,8 @@ define([ this._setSelectionMode(selectionMode); }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); // Remove any extra handles added by Selection. if (this._selectstartHandle) { @@ -220,8 +220,8 @@ define([ // Don't run if selection mode doesn't have a handler (incl. "none"), target can't be selected, // or if coming from a dgrid-cellfocusin from a mousedown if (!this[this._selectionHandlerName] || !this.allowSelect(this.row(target)) || - (event.type === 'dgrid-cellfocusin' && event.parentType === 'mousedown') || - (event.type === upType && target !== this._waitForMouseUp)) { + (event.type === 'dgrid-cellfocusin' && event.parentType === 'mousedown') || + (event.type === upType && target !== this._waitForMouseUp)) { return; } this._waitForMouseUp = null; @@ -297,7 +297,7 @@ define([ // Clear selection first for right-clicks outside selection and non-ctrl-clicks; // otherwise, extended mode logic is identical to multiple mode if (event.button === 2 ? !this.isSelected(target) : - !(event.keyCode ? event.ctrlKey : event[ctrlEquiv])) { + !(event.keyCode ? event.ctrlKey : event[ctrlEquiv])) { this.clearSelection(null, true); } this._multipleSelectionHandler(event, target); @@ -362,7 +362,7 @@ define([ if (this.allowSelectAll) { this.on('keydown', function (event) { if (event[ctrlEquiv] && event.keyCode === 65 && - !/\bdgrid-input\b/.test(event.target.className)) { + !/\bdgrid-input\b/.test(event.target.className)) { event.preventDefault(); grid[grid.allSelected ? 'clearSelection' : 'selectAll'](); } @@ -682,16 +682,16 @@ define([ this.allSelected && (!object.data || this.allowSelect(object)); }, - refresh: function () { + refresh: function refresh() { if (this.deselectOnRefresh) { this.clearSelection(); } this._lastSelected = null; - return this.inherited(arguments); + return this.inherited(refresh, arguments); }, - renderArray: function () { - var rows = this.inherited(arguments), + renderArray: function renderArray() { + var rows = this.inherited(renderArray, arguments), selection = this.selection, i, row, diff --git a/Selector.js b/Selector.js index 3a613091c..2c0bdd887 100644 --- a/Selector.js +++ b/Selector.js @@ -23,8 +23,8 @@ define([ // * object - the row's data object // The custom renderSelectorInput function must return an input field. - postCreate: function () { - this.inherited(arguments); + postCreate: function postCreate() { + this.inherited(postCreate, arguments); // Register one listener at the top level that receives events delegated var handleSelectorClick = lang.hitch(this, '_handleSelectorClick'); @@ -118,7 +118,7 @@ define([ if (row) { if (event.shiftKey) { // Make sure the last input always ends up checked for shift key - this._changeSelectorInput(true, {rows: [row]}); + this._changeSelectorInput(true, { rows: [row] }); } else { // No shift key, so no range selection @@ -206,8 +206,8 @@ define([ } }, - configStructure: function () { - this.inherited(arguments); + configStructure: function configStructure() { + this.inherited(configStructure, arguments); var columns = this.columns; this._selectorColumns = []; this._hasSelectorHeaderCheckbox = this._selectorSingleRow = false; @@ -219,11 +219,11 @@ define([ } }, - _handleSelect: function (event) { + _handleSelect: function _handleSelect(event) { // Ignore the default select handler for events that originate from the selector column var column = this.cell(event).column; if (!column || !column.selector) { - this.inherited(arguments); + this.inherited(_handleSelect, arguments); } } }); diff --git a/Tree.js b/Tree.js index 814e62c95..6690b59fa 100644 --- a/Tree.js +++ b/Tree.js @@ -14,7 +14,7 @@ define([ './Grid', 'dojo/has!touch?./util/touch' ], function (declare, lang, arrayUtil, aspect, Deferred, domConstruct, domClass, on, all, querySelector, when, has, - Grid, touchUtil) { + Grid, touchUtil) { return declare(null, { // collapseOnRefresh: Boolean @@ -214,8 +214,8 @@ define([ return when(promise); }, - _configColumns: function () { - var columnArray = this.inherited(arguments); + _configColumns: function _configColumns() { + var columnArray = this.inherited(_configColumns, arguments); // Set up hash to store IDs of expanded rows (here rather than in // _configureTreeColumn so nothing breaks if no column has renderExpando) @@ -230,13 +230,13 @@ define([ return columnArray; }, - insertRow: function (object, container, beforeNode, i, options) { + insertRow: function insertRow(object, container, beforeNode, i, options) { options = options || {}; var level = options.queryLevel = 'queryLevel' in options ? options.queryLevel : 'level' in container ? container.level : 0; - var rowElement = this.inherited(arguments); + var rowElement = this.inherited(insertRow, arguments); // Auto-expand (shouldExpand) considerations var row = this.row(rowElement), @@ -277,8 +277,8 @@ define([ } }, - _queueNodeForDeletion: function (node) { - this.inherited(arguments); + _queueNodeForDeletion: function _queueNodeForDeletion(node) { + this.inherited(_queueNodeForDeletion, arguments); var connected = node.connected; if (connected) { @@ -286,7 +286,7 @@ define([ } }, - _pruneRow: function (rowElement, removeBelow) { + _pruneRow: function _pruneRow(rowElement, removeBelow) { var connected = rowElement.connected; var preloadNode; var preload; @@ -305,13 +305,13 @@ define([ } } - this.inherited(arguments, [rowElement, removeBelow, { + this.inherited(_pruneRow, arguments, [rowElement, removeBelow, { treePrune: true, removeBelow: removeBelow }]); }, - refresh: function (options) { + refresh: function refresh(options) { // Restoring the previous scroll position with OnDemandList is not possible in some cases with // nested expanded nodes. In those cases, restoring the position would require scrolling and // loading rows incrementally to make sure the expanded rows are loaded and expanded. dgrid is not @@ -321,9 +321,9 @@ define([ this._expandPromises = []; var keepScrollPosition = this.keepScrollPosition || (options && options.keepScrollPosition); if (keepScrollPosition && Object.keys(this._expanded).length) { - refreshResult = this.inherited(arguments, lang.mixin(options || {}, { keepScrollPosition: false })); + refreshResult = this.inherited(refresh, arguments, lang.mixin(options || {}, { keepScrollPosition: false })); } else { - refreshResult = this.inherited(arguments); + refreshResult = this.inherited(refresh, arguments); } return when(refreshResult).then(function () { var promises = this._expandPromises; @@ -332,7 +332,7 @@ define([ }.bind(this)); }, - removeRow: function (rowElement, preserveDom, options) { + removeRow: function removeRow(rowElement, preserveDom, options) { var connected = rowElement.connected, childOptions = {}, childRows, @@ -383,21 +383,21 @@ define([ } } - this.inherited(arguments); + this.inherited(removeRow, arguments); }, - _refreshCellFromItem: function (cell, item) { + _refreshCellFromItem: function _refreshCellFromItem(cell, item) { if (!cell.column.renderExpando) { - return this.inherited(arguments); + return this.inherited(_refreshCellFromItem, arguments); } - this.inherited(arguments, [cell, item, { + this.inherited(_refreshCellFromItem, arguments, [cell, item, { queryLevel: querySelector('.dgrid-expando-icon', cell.element)[0].level }]); }, - cleanup: function () { - this.inherited(arguments); + cleanup: function cleanup() { + this.inherited(cleanup, arguments); if (this.collapseOnRefresh) { // Clear out the _expanded hash on each call to cleanup @@ -406,8 +406,8 @@ define([ } }, - _destroyColumns: function () { - this.inherited(arguments); + _destroyColumns: function _destroyColumns() { + this.inherited(_destroyColumns, arguments); var listeners = this._treeColumnListeners; for (var i = listeners.length; i--;) { @@ -417,12 +417,12 @@ define([ this._treeColumn = null; }, - _calcRowHeight: function (rowElement) { + _calcRowHeight: function _calcRowHeight(rowElement) { // Override this method to provide row height measurements that // include the children of a row var connected = rowElement.connected; // if connected, need to consider this in the total row height - return this.inherited(arguments) + (connected ? connected.offsetHeight : 0); + return this.inherited(_calcRowHeight, arguments) + (connected ? connected.offsetHeight : 0); }, _configureTreeColumn: function (column) { @@ -474,8 +474,8 @@ define([ var row = grid.row(event); if ((!grid.collection.mayHaveChildren || grid.collection.mayHaveChildren(row.data)) && (event.type !== 'keydown' || event.keyCode === 32) && !(event.type === 'dblclick' && - clicked && clicked.count > 1 && row.id === clicked.id && - event.target.className.indexOf('dgrid-expando-icon') > -1)) { + clicked && clicked.count > 1 && row.id === clicked.id && + event.target.className.indexOf('dgrid-expando-icon') > -1)) { grid.expand(row); } @@ -531,11 +531,11 @@ define([ }); }, - _onNotification: function (rows, event) { + _onNotification: function _onNotification(rows, event) { if (event.type === 'delete') { this._resetExpanded(event.id); } - this.inherited(arguments); + this.inherited(_onNotification, arguments); }, _onTreeTransitionEnd: function (event) { @@ -613,8 +613,8 @@ define([ } }, - _calculatePreloadHeight: function (preload) { - var newHeight = this.inherited(arguments); + _calculatePreloadHeight: function _calculatePreloadHeight(preload) { + var newHeight = this.inherited(_calculatePreloadHeight, arguments); var expandedContent = preload.expandedContent; if (expandedContent) { Object.keys(expandedContent).forEach(function (key) { @@ -624,11 +624,11 @@ define([ return newHeight; }, - _getRenderedCollection: function (preload) { + _getRenderedCollection: function _getRenderedCollection(preload) { if (preload.level) { return preload.query.collection; } else { - return this.inherited(arguments); + return this.inherited(_getRenderedCollection, arguments); } } }); diff --git a/_StoreMixin.js b/_StoreMixin.js index 8c60c8090..9b281be75 100644 --- a/_StoreMixin.js +++ b/_StoreMixin.js @@ -93,8 +93,8 @@ define([ })); }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); if (this._structureHandle) { this._structureHandle.remove(); @@ -107,14 +107,14 @@ define([ } }, - _configColumn: function (column) { + _configColumn: function _configColumn(column) { // summary: // Implements extension point provided by Grid to store references to // any columns with `set` methods, for use during `save`. if (column.set) { this._columnsWithSet[column.field] = column; } - this.inherited(arguments); + this.inherited(_configColumn, arguments); }, _setCollection: function (collection) { @@ -257,17 +257,17 @@ define([ return false; // Indicate there was no noDataNode. }, - row: function () { + row: function row() { // Extend List#row with more appropriate lookup-by-id logic - var row = this.inherited(arguments); + var row = this.inherited(row, arguments); if (row && row.data && typeof row.id !== 'undefined') { row.id = this.collection.getIdentity(row.data); } return row; }, - refresh: function () { - var result = this.inherited(arguments); + refresh: function refresh() { + var result = this.inherited(refresh, arguments); if (!this.collection) { this._insertNoDataNode(); @@ -276,12 +276,12 @@ define([ return result; }, - refreshCell: function (cell) { + refreshCell: function refreshCell(cell) { if (!this.collection || !this._createBodyRowCell) { throw new Error('refreshCell requires a Grid with a collection.'); } - this.inherited(arguments); + this.inherited(refreshCell, arguments); return this.collection.get(cell.row.id).then(lang.hitch(this, '_refreshCellFromItem', cell)); }, @@ -298,8 +298,8 @@ define([ this._createBodyRowCell(cellElement, cell.column, item, options); }, - renderArray: function () { - var rows = this.inherited(arguments); + renderArray: function renderArray() { + var rows = this.inherited(renderArray, arguments); if (!this.collection) { if (rows.length && this.noDataNode) { @@ -309,7 +309,7 @@ define([ return rows; }, - insertRow: function (object, parent, beforeNode, i, options) { + insertRow: function insertRow(object, parent, beforeNode, i, options) { var store = this.collection, dirty = this.dirty, id = store && store.getIdentity(object), @@ -325,7 +325,7 @@ define([ object = lang.delegate(object, dirtyObj); } - row = this.inherited(arguments); + row = this.inherited(insertRow, arguments); if (options && options.rows) { options.rows[i] = row; @@ -478,7 +478,7 @@ define([ }, removeRow: function (rowElement, preserveDom, options) { - var row = {element: rowElement}; + var row = { element: rowElement }; // Check to see if we are now empty... if (!preserveDom && (this.up(row).element === rowElement) && (this.down(row).element === rowElement)) { // ...we are empty, so show the no data message. @@ -490,7 +490,7 @@ define([ delete rows[rowElement.rowIndex]; } - return this.inherited(arguments); + return this.inherited(removeRow, arguments); }, renderQueryResults: function (results, beforeNode, options) { @@ -550,7 +550,7 @@ define([ rows.splice(from, 1); if (event.type === 'delete' || - (event.type === 'update' && (from < to || to === undefined))) { + (event.type === 'update' && (from < to || to === undefined))) { // adjust the rowIndex so adjustRowIndices has the right starting point rows[from] && rows[from].rowIndex--; } diff --git a/extensions/ColumnHider.js b/extensions/ColumnHider.js index c390292eb..08b0e70fc 100644 --- a/extensions/ColumnHider.js +++ b/extensions/ColumnHider.js @@ -7,23 +7,23 @@ define([ '../util/misc', 'dojo/i18n!./nls/columnHider' ], function (arrayUtil, declare, domConstruct, has, listen, miscUtil, i18n) { -/* - * Column Hider plugin for dgrid - * Originally contributed by TRT 2011-09-28 - * - * A dGrid plugin that attaches a menu to a dgrid, along with a way of opening it, - * that will allow you to show and hide columns. A few caveats: - * - * 1. Menu placement is entirely based on CSS definitions. - * 2. If you want columns initially hidden, you must add "hidden: true" to your - * column definition. - * 3. This implementation DOES support ColumnSet, but has not been tested - * with multi-subrow records. - * 4. Column show/hide is controlled via straight up HTML checkboxes. If you - * are looking for something more fancy, you'll probably need to use this - * definition as a template to write your own plugin. - * - */ + /* + * Column Hider plugin for dgrid + * Originally contributed by TRT 2011-09-28 + * + * A dGrid plugin that attaches a menu to a dgrid, along with a way of opening it, + * that will allow you to show and hide columns. A few caveats: + * + * 1. Menu placement is entirely based on CSS definitions. + * 2. If you want columns initially hidden, you must add "hidden: true" to your + * column definition. + * 3. This implementation DOES support ColumnSet, but has not been tested + * with multi-subrow records. + * 4. Column show/hide is controlled via straight up HTML checkboxes. If you + * are looking for something more fancy, you'll probably need to use this + * definition as a template to write your own plugin. + * + */ var activeGrid, // references grid for which the menu is currently open bodyListener; // references pausable event handler for body mousedown @@ -143,7 +143,7 @@ define([ } }, - renderHeader: function () { + renderHeader: function renderHeader() { var grid = this, hiderMenuNode = this.hiderMenuNode, hiderToggleNode = this.hiderToggleNode, @@ -156,7 +156,7 @@ define([ event.stopPropagation(); } - this.inherited(arguments); + this.inherited(renderHeader, arguments); if (!hiderMenuNode) { // First run @@ -213,7 +213,7 @@ define([ // Hook up delegated listener for modifications to checkboxes. this._listeners.push(listen(hiderMenuNode, - '.dgrid-hider-menu-check:' + (has('ie') < 9 ? 'click' : 'change'), + '.dgrid-hider-menu-check:' + (has('ie') < 9 ? 'click' : 'change'), function (e) { grid._updateColumnHiddenState( getColumnIdFromCheckbox(e.target, grid), !e.target.checked); @@ -253,8 +253,8 @@ define([ this._renderHiderMenuEntries(); }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); // Remove any remaining rules applied to hidden columns. for (var id in this._columnHiderRules) { this._columnHiderRules[id].remove(); @@ -265,16 +265,16 @@ define([ return this.right(cell, -steps); }, - right: function (cell, steps) { + right: function right(cell, steps) { if (!cell.element) { cell = this.cell(cell); } - var nextCell = this.inherited(arguments), + var nextCell = this.inherited(right, arguments), prevCell = cell; // Skip over hidden cells while (nextCell.column.hidden) { - nextCell = this.inherited(arguments, [nextCell, steps > 0 ? 1 : -1]); + nextCell = this.inherited(right, arguments, [nextCell, steps > 0 ? 1 : -1]); if (prevCell.element === nextCell.element) { // No further visible cell found - return original return cell; diff --git a/extensions/ColumnReorder.js b/extensions/ColumnReorder.js index bfe0c8092..04b516573 100644 --- a/extensions/ColumnReorder.js +++ b/extensions/ColumnReorder.js @@ -54,13 +54,13 @@ define([ return source === this; // self-accept only }, - _legalMouseDown: function (evt) { + _legalMouseDown: function _legalMouseDown(evt) { // Overridden to prevent blocking ColumnResizer resize handles. return evt.target.className.indexOf('dgrid-resize-handle') > -1 ? false : - this.inherited(arguments); + this.inherited(_legalMouseDown, arguments); }, - onDropInternal: function (nodes) { + onDropInternal: function onDropInternal(nodes) { var grid = this.grid, match = dndTypeRx.exec(stripIdPrefix(grid.id, nodes[0].getAttribute('dndType'))), structureProperty = match[2] ? 'columnSets' : 'subRows', @@ -68,7 +68,7 @@ define([ columns = grid.columns; // First, allow original DnD logic to place node in new location. - this.inherited(arguments); + this.inherited(onDropInternal, arguments); if (!match) { return; @@ -79,8 +79,8 @@ define([ // (Wait until the next turn to avoid errors in Opera.) setTimeout(function () { var newSubRow = arrayUtil.map(nodes[0].parentNode.childNodes, function (col) { - return columns[col.columnId]; - }), + return columns[col.columnId]; + }), eventObject; setMatchingSubRow(grid, match, newSubRow); @@ -161,11 +161,11 @@ define([ // (If dndParent wasn't set, no columns are draggable) }, - renderHeader: function () { + renderHeader: function renderHeader() { var dndTypePrefix = makeDndTypePrefix(this.id), csLength, cs; - this.inherited(arguments); + this.inherited(renderHeader, arguments); // After header is rendered, set up a dnd source on each of its subrows. @@ -193,7 +193,7 @@ define([ } }, - _destroyColumns: function () { + _destroyColumns: function _destroyColumns() { if (this._columnDndSources) { // Destroy old dnd sources. arrayUtil.forEach(this._columnDndSources, function (source) { @@ -201,7 +201,7 @@ define([ }); } - this.inherited(arguments); + this.inherited(_destroyColumns, arguments); } }); diff --git a/extensions/ColumnResizer.js b/extensions/ColumnResizer.js index 001505571..5a611925d 100644 --- a/extensions/ColumnResizer.js +++ b/extensions/ColumnResizer.js @@ -184,8 +184,8 @@ define([ _resizedColumns: false, // flag indicating if resizer has converted column widths to px - buildRendering: function () { - this.inherited(arguments); + buildRendering: function buildRendering() { + this.inherited(buildRendering, arguments); // Create resizerNode when first grid w/ ColumnResizer is created if (!resizableCount) { @@ -194,8 +194,8 @@ define([ resizableCount++; }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); // Remove any applied column size styles since we're tracking them directly for (var name in this._columnSizes) { @@ -219,14 +219,14 @@ define([ return resizeColumnWidth(this, colId, width); }, - configStructure: function () { + configStructure: function configStructure() { var oldSizes = this._oldColumnSizes = lang.mixin({}, this._columnSizes), // shallow clone k; this._resizedColumns = false; this._columnSizes = {}; - this.inherited(arguments); + this.inherited(configStructure, arguments); // Remove old column styles that are no longer relevant; this is specifically // done *after* calling inherited so that _columnSizes will contain keys @@ -239,8 +239,8 @@ define([ delete this._oldColumnSizes; }, - _configColumn: function (column) { - this.inherited(arguments); + _configColumn: function _configColumn(column) { + this.inherited(_configColumn, arguments); var colId = column.id, rule; @@ -259,8 +259,8 @@ define([ } }, - renderHeader: function () { - this.inherited(arguments); + renderHeader: function renderHeader() { + this.inherited(renderHeader, arguments); var grid = this; @@ -307,7 +307,7 @@ define([ // establish listeners for initiating, dragging, and finishing resize listen(grid.headerNode, '.dgrid-resize-handle:mousedown' + - (has('touch') ? ',.dgrid-resize-handle:touchstart' : ''), + (has('touch') ? ',.dgrid-resize-handle:touchstart' : ''), function (e) { grid._resizeMouseDown(e, this); grid.mouseMoveListen.resume(); @@ -320,7 +320,7 @@ define([ miscUtil.throttleDelayed(function (e) { grid._updateResizerPosition(e); }) - )); + )); grid._listeners.push(grid.mouseUpListen = listen.pausable(document, 'mouseup' + (has('touch') ? ',touchend' : ''), function (e) { @@ -488,7 +488,7 @@ define([ while (i--) { totalWidth += colNodes[i].offsetWidth; } - return {totalWidth: totalWidth, lastColId: lastColId}; + return { totalWidth: totalWidth, lastColId: lastColId }; } }); }); diff --git a/extensions/CompoundColumns.js b/extensions/CompoundColumns.js index 471b91a99..6f944661a 100644 --- a/extensions/CompoundColumns.js +++ b/extensions/CompoundColumns.js @@ -21,7 +21,7 @@ define([ // In addition, the deepest child columns may be rendered without // individual headers by specifying `showChildHeaders: false` on the parent. - configStructure: function () { + configStructure: function configStructure() { // create a set of sub rows for the header row so we can do compound columns // the first row is a special spacer row var columns = (this.subRows && this.subRows[0]) || this.columns, @@ -35,7 +35,7 @@ define([ function processColumns(columns, level, hasLabel, parent) { var numColumns = 0, - noop = function () {}, + noop = function () { }, children, hasChildLabels; @@ -43,7 +43,7 @@ define([ // Handle the column config when it is an object rather // than an array. if (typeof column === 'string') { - column = {label: column}; + column = { label: column }; } if (!(columns instanceof Array) && !column.field) { column.field = i; @@ -69,14 +69,14 @@ define([ // it has no children, it is a normal header, add it to the content columns contentColumns.push(column); // add each one to the first spacer header row for proper layout of the header cells - topHeaderRow.push(lang.delegate(column, {renderHeaderCell: noop})); + topHeaderRow.push(lang.delegate(column, { renderHeaderCell: noop })); numColumns++; } if (!hasChildLabels) { // create a header version of the column where we can define a specific rowSpan // we define the rowSpan as a negative, the number of levels less than the // total number of rows, which we don't know yet - column = lang.delegate(column, {rowSpan: -level}); + column = lang.delegate(column, { rowSpan: -level }); } if (children) { @@ -118,15 +118,15 @@ define([ // configuration for rendering the headers contentColumns.headerRows = headerRows; this.subRows = contentColumns; - this.inherited(arguments); + this.inherited(configStructure, arguments); }, - renderHeader: function () { + renderHeader: function renderHeader() { var i, columns = this.subRows[0], headerColumns = this.subRows.headerRows[0]; - this.inherited(arguments); + this.inherited(renderHeader, arguments); // The object delegation performed in configStructure unfortunately // "protects" the original column definition objects (referenced by @@ -137,8 +137,8 @@ define([ } }, - _findSortArrowParent: function () { - var parent = this.inherited(arguments), + _findSortArrowParent: function _findSortArrowParent() { + var parent = this.inherited(_findSortArrowParent, arguments), spacerRow = query('.dgrid-spacer-row', this.headerNode)[0], columnId, nodes; @@ -150,7 +150,7 @@ define([ } }, - _configColumn: function (column, rowColumns, prefix) { + _configColumn: function _configColumn(column, rowColumns, prefix) { // Updates the id on a column definition that is a child to include // the parent's id. var parent = column.parentColumn; @@ -162,10 +162,10 @@ define([ prefix = parent.id + '-'; columnId = column.id = prefix + id; } - this.inherited(arguments, [column, rowColumns, prefix]); + this.inherited(_configColumn, arguments, [column, rowColumns, prefix]); }, - cell: function (target, columnId) { + cell: function cell(target, columnId) { // summary: // Get the cell object by node, event, or id, plus a columnId. // This extension prefixes children's column ids with the parents' column ids, @@ -179,14 +179,14 @@ define([ columnId = column.id; } } - return this.inherited(arguments, [target, columnId]); + return this.inherited(cell, arguments, [target, columnId]); }, - column: function (target) { + column: function column(target) { // summary: // Get the column object by node, event, or column id. Take into account parent column id // prefixes that may be added by this extension. - var results = this.inherited(arguments); + var results = this.inherited(column, arguments); if (results == null && typeof target !== 'object') { // Find a column id that ends with the provided column id. This will locate a child column // by an id that was provided in the original column configuration. For example, if a compound column @@ -235,11 +235,11 @@ define([ } }, - _hideColumn: function (id) { + _hideColumn: function _hideColumn(id) { var self = this; this._updateCompoundHiddenStates(id, true); - this.inherited(arguments); + this.inherited(_hideColumn, arguments); if (has('ff')) { // Firefox causes display quirks in certain situations; @@ -252,9 +252,9 @@ define([ } }, - _showColumn: function (id) { + _showColumn: function _showColumn(id) { this._updateCompoundHiddenStates(id, false); - this.inherited(arguments); + this.inherited(_showColumn, arguments); }, _getResizedColumnWidths: function () { diff --git a/extensions/DijitRegistry.js b/extensions/DijitRegistry.js index 30499131b..9a4c34d8f 100644 --- a/extensions/DijitRegistry.js +++ b/extensions/DijitRegistry.js @@ -18,18 +18,18 @@ define([ layoutPriority: 0, // BorderContainer showTitle: true, // StackContainer - buildRendering: function () { + buildRendering: function buildRendering() { registry.add(this); - this.inherited(arguments); + this.inherited(buildRendering, arguments); // Note: for dojo 2.0 may rename widgetId to dojo._scopeName + "_widgetId" this.domNode.setAttribute('widgetId', this.id); }, - startup: function () { + startup: function startup() { if (this._started) { return; } - this.inherited(arguments); + this.inherited(startup, arguments); var widget = this.getParent(); // If we have a parent layout container widget, it will handle resize, @@ -43,8 +43,8 @@ define([ this.destroy(); }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); registry.remove(this.id); }, @@ -73,13 +73,13 @@ define([ return wbPrototype.placeAt.call(this, reference, position); }, - resize: function (changeSize) { + resize: function resize(changeSize) { // Honor changeSize parameter used by layout widgets, and resize grid if (changeSize) { domGeometry.setMarginBox(this.domNode, changeSize); } - this.inherited(arguments); + this.inherited(resize, arguments); }, _set: function (prop, value) { diff --git a/extensions/DnD.js b/extensions/DnD.js index 7b2f8bc12..0fd62d588 100644 --- a/extensions/DnD.js +++ b/extensions/DnD.js @@ -14,7 +14,7 @@ define([ '../Selection', 'dojo/has!touch?../util/touch' ], function (declare, lang, arrayUtil, aspect, domClass, topic, touch, has, when, DnDSource, - DnDManager, NodeList, Selection, touchUtil) { + DnDManager, NodeList, Selection, touchUtil) { // Requirements // * requires a store (sounds obvious, but not all Lists/Grids have stores...) // * must support options.before in put calls @@ -39,10 +39,10 @@ define([ return grid.collection.get(node.id.slice(grid.id.length + 5)); }); }, - _legalMouseDown: function (evt) { + _legalMouseDown: function _legalMouseDown(evt) { // Fix _legalMouseDown to only allow starting drag from an item // (not from bodyNode outside contentNode). - var legal = this.inherited(arguments); + var legal = this.inherited(_legalMouseDown, arguments); return legal && evt.target !== this.grid.bodyNode; }, @@ -93,7 +93,7 @@ define([ // dropping last node into empty space beyond rendered rows.) nodeRow = grid.row(nodes[0]); if (!copy && (targetRow === nodes[0] || - (!targetItem && nodeRow && grid.down(nodeRow).element === nodes[0]))) { + (!targetItem && nodeRow && grid.down(nodeRow).element === nodes[0]))) { return; } @@ -182,10 +182,10 @@ define([ }); }, - onDndStart: function (source) { + onDndStart: function onDndStart(source) { // Listen for start events to apply style change to avatar. - this.inherited(arguments); // DnDSource.prototype.onDndStart.apply(this, arguments); + this.inherited(onDndStart, arguments); // DnDSource.prototype.onDndStart.apply(this, arguments); if (source === this) { // Set avatar width to half the grid's width. // Kind of a naive default, but prevents ridiculously wide avatars. @@ -194,23 +194,23 @@ define([ } }, - onMouseDown: function (evt) { + onMouseDown: function onMouseDown(evt) { // Cancel the drag operation on presence of more than one contact point. // (This check will evaluate to false under non-touch circumstances.) if (has('touch') && this.isDragging && - touchUtil.countCurrentTouches(evt, this.grid.touchNode) > 1) { + touchUtil.countCurrentTouches(evt, this.grid.touchNode) > 1) { topic.publish('/dnd/cancel'); DnDManager.manager().stopDrag(); } else { - this.inherited(arguments); + this.inherited(onMouseDown, arguments); } }, - onMouseMove: function (evt) { + onMouseMove: function onMouseMove(evt) { // If we're handling touchmove, only respond to single-contact events. if (!has('touch') || touchUtil.countCurrentTouches(evt, this.grid.touchNode) <= 1) { - this.inherited(arguments); + this.inherited(onMouseMove, arguments); } }, @@ -219,12 +219,12 @@ define([ return source.getObject && DnDSource.prototype.checkAcceptance.apply(this, arguments); }, - getSelectedNodes: function () { + getSelectedNodes: function getSelectedNodes() { // If dgrid's Selection mixin is in use, synchronize with it, using a // map of node references (updated on dgrid-[de]select events). if (!this.grid.selection) { - return this.inherited(arguments); + return this.inherited(getSelectedNodes, arguments); } var t = new NodeList(), id; @@ -256,8 +256,8 @@ define([ // Defaults to the GridSource constructor defined/exposed by this module. dndConstructor: GridDnDSource, - postMixInProperties: function () { - this.inherited(arguments); + postMixInProperties: function postMixInProperties() { + this.inherited(postMixInProperties, arguments); // ensure dndParams is initialized this.dndParams = lang.mixin({ accept: [this.dndSourceType] }, this.dndParams); @@ -271,8 +271,8 @@ define([ this.mouseDownEventType = touch.press; }, - postCreate: function () { - this.inherited(arguments); + postCreate: function postCreate() { + this.inherited(postCreate, arguments); // Make the grid's content a DnD source/target. var Source = this.dndConstructor || GridDnDSource; @@ -319,9 +319,9 @@ define([ ); }, - insertRow: function (object) { + insertRow: function insertRow(object) { // override to add dojoDndItem class to make the rows draggable - var row = this.inherited(arguments), + var row = this.inherited(insertRow, arguments), type = typeof this.getObjectDndType === 'function' ? this.getObjectDndType(object) : [this.dndSourceType]; @@ -341,7 +341,7 @@ define([ return row; }, - removeRow: function (rowElement) { + removeRow: function removeRow(rowElement) { var row = this.row(rowElement); if (this.selection && (row.id in this.selection)) { @@ -349,7 +349,7 @@ define([ } this.dndSource.delItem(row.element.id); - this.inherited(arguments); + this.inherited(removeRow, arguments); } }); DnD.GridSource = GridDnDSource; diff --git a/extensions/Pagination.js b/extensions/Pagination.js index 5aa608468..7bed69530 100644 --- a/extensions/Pagination.js +++ b/extensions/Pagination.js @@ -84,8 +84,8 @@ define([ _currentPage: 1, _loadingCount: 0, - buildRendering: function () { - this.inherited(arguments); + buildRendering: function buildRendering() { + this.inherited(buildRendering, arguments); // add pagination to footer var grid = this, @@ -194,8 +194,8 @@ define([ })); }, - destroy: function () { - this.inherited(arguments); + destroy: function destroy() { + this.inherited(destroy, arguments); if (this._pagingTextBoxChangeHandle) { this._pagingTextBoxChangeHandle.remove(); } @@ -455,7 +455,7 @@ define([ }); }, - refresh: function (options) { + refresh: function refresh(options) { // summary: // Re-renders the first page of data, or the current page if // options.keepCurrentPage is true. @@ -464,7 +464,7 @@ define([ var page = options && options.keepCurrentPage ? Math.min(this._currentPage, Math.ceil(this._total / this.rowsPerPage)) : 1; - this.inherited(arguments); + this.inherited(refresh, arguments); // Reset to first page and return promise from gotoPage return this.gotoPage(page).then(function (results) { @@ -492,9 +492,9 @@ define([ } }, - renderQueryResults: function (results, beforeNode) { + renderQueryResults: function renderQueryResults(results, beforeNode) { var grid = this, - rows = this.inherited(arguments); + rows = this.inherited(renderQueryResults, arguments); if (!beforeNode) { if (this._topLevelRequest) { @@ -519,9 +519,9 @@ define([ return rows; }, - insertRow: function () { + insertRow: function insertRow() { var oldNodes = this._oldPageNodes, - row = this.inherited(arguments); + row = this.inherited(insertRow, arguments); if (oldNodes && row === oldNodes[row.id]) { // If the previous row was reused, avoid removing it in cleanup diff --git a/extensions/SingleQuery.js b/extensions/SingleQuery.js index 433792c01..826b330c9 100644 --- a/extensions/SingleQuery.js +++ b/extensions/SingleQuery.js @@ -11,12 +11,12 @@ define([ // Appropriate for grids using memory stores with small // result set sizes. - refresh: function () { + refresh: function refresh() { var self = this; // First defer to List#refresh to clear the grid's // previous content - this.inherited(arguments); + this.inherited(refresh, arguments); if (!this._renderedCollection) { return; @@ -51,8 +51,8 @@ define([ }); }, - renderArray: function () { - var rows = this.inherited(arguments); + renderArray: function renderArray() { + var rows = this.inherited(renderArray, arguments); // Clear _lastCollection which is ordinarily only used for store-less grids this._lastCollection = null;