Permalink
Browse files

Minor code reduction

  • Loading branch information...
1 parent 9b21177 commit 4ebd63e3b13c6fa03140bcf02014f17af8ff1f45 @kriszyp committed Oct 20, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 Grid.js
View
10 Grid.js
@@ -258,12 +258,10 @@ define(["dojo/has", "put-selector/put", "dojo/_base/declare", "dojo/on", "./Edit
// summary:
// Extension of List.js sort to update sort arrow in UI
- var prop = property, desc = descending;
-
// If a full-on sort array was passed, only handle the first criteria
if(typeof property != "string"){
- prop = property[0].attribute;
- desc = property[0].descending;
+ descending = property[0].descending;
+ property = property[0].attribute;
}
// if we were invoked from a header cell click handler, grab
@@ -273,7 +271,7 @@ define(["dojo/has", "put-selector/put", "dojo/_base/declare", "dojo/on", "./Edit
columns = this.columns;
for(i in columns){
column = columns[i];
- if(column.field == prop){
+ if(column.field == property){
target = column.headerNode;
}
}
@@ -290,7 +288,7 @@ define(["dojo/has", "put-selector/put", "dojo/_base/declare", "dojo/on", "./Edit
// place sort arrow under clicked node, and add up/down sort class
this._lastSortedArrow = put(target.firstChild, "-div.dgrid-sort-arrow.ui-icon[role=presentation]");
this._lastSortedArrow.innerHTML = " ";
- put(target, desc ? ".dgrid-sort-down" : ".dgrid-sort-up");
+ put(target, descending ? ".dgrid-sort-down" : ".dgrid-sort-up");
// call resize in case relocation of sort arrow caused any height changes
this.resize();

0 comments on commit 4ebd63e

Please sign in to comment.