+ /**
+ * Sort the window list
+ */
+ sortWindowList: function () {
+ var win_list = $('#kiwi .windowlist ul');
+ var listitems = win_list.children('li').get();
+ console.log(Tabview.getServerTab().tab);
+ listitems.sort(function (a, b) {
+ console.log(a);
+ if (a == Tabview.getServerTab().tab) {
+ return 1;
+ }
+ if (b == Tabview.getServerTab().tab) {
+ return -1;
+ }
+ var compA = $(a).text().toUpperCase();
+ var compB = $(b).text().toUpperCase();
+ return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
+ })
+
+ $.each(listitems, function(idx, itm) {
+ win_list.append(itm);
+ });
+ },
+
+
+