Skip to content

Commit

Permalink
one last minor hotfix/lint to navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
orneryd committed Dec 18, 2012
1 parent ab94c02 commit bb8a1ba
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
16 changes: 8 additions & 8 deletions build/KoGrid.debug.js
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/18/2012 15:27:17
* Compiled At: 12/18/2012 15:37:41
***********************************************/

(function (window) {
Expand Down Expand Up @@ -42,14 +42,14 @@ window.kg.moveSelectionHandler = function(grid, evt) {
if (window.kg.utils.isNullOrUndefined(grid) || window.kg.utils.isNullOrUndefined(grid.config.selectedItems)) {
return true;
}
var charCode = (evt.which) ? evt.which : event.keyCode;
// detect which direction for arrow keys to navigate the grid
var offset = (charCode == 38 ? -1 : (charCode == 40 ? 1 : null));
var charCode = evt.which || evt.keyCode,
// detect which direction for arrow keys to navigate the grid
offset = (charCode === 38 ? -1 : (charCode === 40 ? 1 : null));
if (!offset) {
return true;
}
var items = grid.renderedRows();
var index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
var items = grid.renderedRows(),
index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
if (index < 0 || index >= items.length) {
return true;
}
Expand Down Expand Up @@ -89,8 +89,8 @@ if (!Array.prototype.indexOf) {
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun /*, thisp */) {
"use strict";
var t = Object(this);
var len = t.length >>> 0;
var t = Object(this),
len = t.length >>> 0;
if (typeof fun !== "function") {
throw new TypeError();
}
Expand Down
16 changes: 8 additions & 8 deletions koGrid-2.1.1.debug.js
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/18/2012 15:27:17
* Compiled At: 12/18/2012 15:37:41
***********************************************/

(function (window) {
Expand Down Expand Up @@ -42,14 +42,14 @@ window.kg.moveSelectionHandler = function(grid, evt) {
if (window.kg.utils.isNullOrUndefined(grid) || window.kg.utils.isNullOrUndefined(grid.config.selectedItems)) {
return true;
}
var charCode = (evt.which) ? evt.which : event.keyCode;
// detect which direction for arrow keys to navigate the grid
var offset = (charCode == 38 ? -1 : (charCode == 40 ? 1 : null));
var charCode = evt.which || evt.keyCode,
// detect which direction for arrow keys to navigate the grid
offset = (charCode === 38 ? -1 : (charCode === 40 ? 1 : null));
if (!offset) {
return true;
}
var items = grid.renderedRows();
var index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
var items = grid.renderedRows(),
index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
if (index < 0 || index >= items.length) {
return true;
}
Expand Down Expand Up @@ -89,8 +89,8 @@ if (!Array.prototype.indexOf) {
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun /*, thisp */) {
"use strict";
var t = Object(this);
var len = t.length >>> 0;
var t = Object(this),
len = t.length >>> 0;
if (typeof fun !== "function") {
throw new TypeError();
}
Expand Down
8 changes: 4 additions & 4 deletions koGrid-2.1.1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/navigation.js
Expand Up @@ -10,14 +10,14 @@ window.kg.moveSelectionHandler = function(grid, evt) {
if (window.kg.utils.isNullOrUndefined(grid) || window.kg.utils.isNullOrUndefined(grid.config.selectedItems)) {
return true;
}
var charCode = (evt.which) ? evt.which : event.keyCode;
// detect which direction for arrow keys to navigate the grid
var offset = (charCode == 38 ? -1 : (charCode == 40 ? 1 : null));
var charCode = evt.which || evt.keyCode,
// detect which direction for arrow keys to navigate the grid
offset = (charCode === 38 ? -1 : (charCode === 40 ? 1 : null));
if (!offset) {
return true;
}
var items = grid.renderedRows();
var index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
var items = grid.renderedRows(),
index = items.indexOf(grid.selectionService.lastClickedRow) + offset;
if (index < 0 || index >= items.length) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Expand Up @@ -25,8 +25,8 @@ if (!Array.prototype.indexOf) {
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun /*, thisp */) {
"use strict";
var t = Object(this);
var len = t.length >>> 0;
var t = Object(this),
len = t.length >>> 0;
if (typeof fun !== "function") {
throw new TypeError();
}
Expand Down

0 comments on commit bb8a1ba

Please sign in to comment.