From 05378f52d3df1c47c8dcafcbe46364c9c73ad3dd Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 29 May 2012 17:07:16 -0400 Subject: [PATCH] CC-3896: Playlist Builder: Using "select this page" to add songs to playlist, those songs will be added in by opposite order, like a stack -fixed --- airtime_mvc/public/js/airtime/library/library.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index c5e1b7495..c21dcf8b4 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -153,10 +153,14 @@ var AIRTIME = (function(AIRTIME) { /* * selects all items which the user can currently see. * (behaviour taken from gmail) + * + * by default the items are selected in reverse order + * so we need to reverse it back */ mod.selectCurrentPage = function() { - var $trs = $libTable.find("tbody input:checkbox").parents("tr"); - + $.fn.reverse = [].reverse; + var $trs = $libTable.find("tbody input:checkbox").parents("tr").reverse(); + $trs.each(function(i, el){ $el = $(this);