Sort tariffs after calculating

This commit is contained in:
Jan Bader 2016-05-14 14:51:52 +02:00
parent e1cc24a8fb
commit f3385bc770

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Gesamtkosten Handyflash // @name Gesamtkosten Handyflash
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @version 0.5 // @version 0.6
// @description Berechnet die Gesamtkosten der Verträge auf handyflash.de // @description Berechnet die Gesamtkosten der Verträge auf handyflash.de
// @author Jan Bader <jan@javil.eu> // @author Jan Bader <jan@javil.eu>
// @match http*://www.handyflash.de/handys/* // @match http*://www.handyflash.de/handys/*
@ -39,5 +39,10 @@
console.log(header + ": " + info); console.log(header + ": " + info);
} }
); );
jQuery('article.rate').sort(function(a,b) {
var valA = $(a).data('gesamt');
var valB = $(b).data('gesamt');
return (valA < valB) ? -1 : (valA > valB) ? 1 : 0;
}).appendTo('#tariff_list_all');
} }
})(); })();