Release 1.2.1

* url.searchParams delete(), append() -> url.searchParams set()
 * right typo
 * add missing ";"
This commit is contained in:
6543 2019-09-18 10:35:42 +02:00
commit 04054ff746
1 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@
@License MIT @License MIT
@Author 6543 @Author 6543
@Repository https://gitea.com/6543/gitea_sortt @Repository https://gitea.com/6543/gitea_sortt
@Version 1.2 @Version 1.2.1


*/ */


@ -17,7 +17,7 @@ if(!window.jQuery) {
//use JQuery to bind event on each <th> with a "data-sortt" attribute //use JQuery to bind event on each <th> with a "data-sortt" attribute
$('th').each(function() { $('th').each(function() {
if ($(this)[0].dataset.sortt) $(this).on('click', function(e) { if ($(this)[0].dataset.sortt) $(this).on('click', function(e) {
var data = $(this)[0].dataset.sortt var data = $(this)[0].dataset.sortt;
data = data.split(","); data = data.split(",");
sortt(data[0],data[1],data[2]); sortt(data[0],data[1],data[2]);
}); });
@ -28,7 +28,7 @@ if(!window.jQuery) {
window.sortt=function(normsort,revsort,isdefault){ window.sortt=function(normsort,revsort,isdefault){
//sortTable [normsort] (revsort) (isdefault) //sortTable [normsort] (revsort) (isdefault)


//normsort is needet //normsort is needed
if (!(normsort)) return false; if (!(normsort)) return false;


//default values of optinal parameters //default values of optinal parameters
@ -50,11 +50,9 @@ window.sortt=function(normsort,revsort,isdefault){
*/ */


if (url_sort != normsort) { if (url_sort != normsort) {
url.searchParams.delete("sort"); url.searchParams.set("sort",normsort);
url.searchParams.append("sort",normsort);
} else if (revsort != "") { } else if (revsort != "") {
url.searchParams.delete("sort"); url.searchParams.set("sort",revsort);
url.searchParams.append("sort",revsort);
} }


//open url //open url