~ahasenack/lazr-js/lazr-js-11.03-packaging

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/recordset/recordset-sort-min.js

  • Committer: Andreas Hasenack
  • Date: 2011-02-21 12:00:54 UTC
  • mfrom: (179.1.2 staging)
  • Revision ID: andreas@canonical.com-20110221120054-w8wweot2a91epe1d
Merging from staging for production deployment

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
 
3
Code licensed under the BSD License:
 
4
http://developer.yahoo.com/yui/license.html
 
5
version: 3.3.0
 
6
build: 3167
 
7
*/
 
8
YUI.add("recordset-sort",function(D){var A=D.ArraySort.compare,C=D.Lang.isValue;function B(E,F,G){B.superclass.constructor.apply(this,arguments);}D.mix(B,{NS:"sort",NAME:"recordsetSort",ATTRS:{lastSortProperties:{value:{field:undefined,desc:true,sorter:undefined},validator:function(E){return(C(E.field)&&C(E.desc)&&C(E.sorter));}},defaultSorter:{value:function(G,E,H,I){var F=A(G.getValue(H),E.getValue(H),I);if(F===0){return A(G.get("id"),E.get("id"),I);}else{return F;}}},isSorted:{value:false}}});D.extend(B,D.Plugin.Base,{initializer:function(F){var E=this,G=this.get("host");this.publish("sort",{defaultFn:D.bind("_defSortFn",this)});this.on("sort",function(){E.set("isSorted",true);});this.onHostEvent("add",function(){E.set("isSorted",false);},G);this.onHostEvent("update",function(){E.set("isSorted",false);},G);},destructor:function(E){},_defSortFn:function(E){this.get("host")._items.sort(function(G,F){return(E.sorter)(G,F,E.field,E.desc);});this.set("lastSortProperties",E);},sort:function(E,F,G){this.fire("sort",{field:E,desc:F,sorter:G||this.get("defaultSorter")});},resort:function(){var E=this.get("lastSortProperties");this.fire("sort",{field:E.field,desc:E.desc,sorter:E.sorter||this.get("defaultSorter")});},reverse:function(){this.get("host")._items.reverse();},flip:function(){var E=this.get("lastSortProperties");if(C(E.field)){this.fire("sort",{field:E.field,desc:!E.desc,sorter:E.sorter||this.get("defaultSorter")});}else{}}});D.namespace("Plugin").RecordsetSort=B;},"3.3.0",{requires:["arraysort","recordset-base","plugin"]});
 
 
b'\\ No newline at end of file'