summaryrefslogtreecommitdiffstats
path: root/js/yui3/recordset-sort
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-12-04 22:13:12 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-12-04 22:13:12 +0100
commit1ee605864f227d40cc83e798dc117ad8e01acb64 (patch)
tree42cc3ff5007202fad4932941b477ac96d5ea0643 /js/yui3/recordset-sort
parentb061ce481380dfd01f85ea84ef700eb7589433e3 (diff)
downloadbugzilla-1ee605864f227d40cc83e798dc117ad8e01acb64.tar.gz
bugzilla-1ee605864f227d40cc83e798dc117ad8e01acb64.tar.xz
Bug 818091 - Install a full copy of YUI3 into the js directory for use with new extensions/projects
Diffstat (limited to 'js/yui3/recordset-sort')
-rw-r--r--js/yui3/recordset-sort/recordset-sort-min.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/yui3/recordset-sort/recordset-sort-min.js b/js/yui3/recordset-sort/recordset-sort-min.js
new file mode 100644
index 000000000..6286443fd
--- /dev/null
+++ b/js/yui3/recordset-sort/recordset-sort-min.js
@@ -0,0 +1,7 @@
+/*
+YUI 3.7.3 (build 5687)
+Copyright 2012 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+YUI.add("recordset-sort",function(e,t){function i(e,t,n){i.superclass.constructor.apply(this,arguments)}var n=e.ArraySort.compare,r=e.Lang.isValue;e.mix(i,{NS:"sort",NAME:"recordsetSort",ATTRS:{lastSortProperties:{value:{field:undefined,desc:!0,sorter:undefined},validator:function(e){return r(e.field)&&r(e.desc)&&r(e.sorter)}},defaultSorter:{value:function(e,t,r,i){var s=n(e.getValue(r),t.getValue(r),i);return s===0?n(e.get("id"),t.get("id"),i):s}},isSorted:{value:!1}}}),e.extend(i,e.Plugin.Base,{initializer:function(t){var n=this,r=this.get("host");this.publish("sort",{defaultFn:e.bind("_defSortFn",this)}),this.on("sort",function(){n.set("isSorted",!0)}),this.onHostEvent("add",function(){n.set("isSorted",!1)},r),this.onHostEvent("update",function(){n.set("isSorted",!1)},r)},destructor:function(e){},_defSortFn:function(e){this.get("host")._items.sort(function(t,n){return e.sorter(t,n,e.field,e.desc)}),this.set("lastSortProperties",e)},sort:function(e,t,n){this.fire("sort",{field:e,desc:t,sorter:n||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");r(e.field)&&this.fire("sort",{field:e.field,desc:!e.desc,sorter:e.sorter||this.get("defaultSorter")})}}),e.namespace("Plugin").RecordsetSort=i},"3.7.3",{requires:["arraysort","recordset-base","plugin"]});