code format

This commit is contained in:
6543 2019-09-18 02:32:50 +02:00
parent 4e68338082
commit ff002275ca
Signed by: 6543
GPG Key ID: A1CA74D27FD13271
1 changed files with 10 additions and 13 deletions

View File

@ -4,27 +4,24 @@
@License MIT
@Author 6543
@Repository https://gitea.com/6543/gitea_sortt
@Version 1.1
@Version 1.2

*/


// test if jQuery is available
if(!window.jQuery)
{
if(!window.jQuery) {
console.log("sortt.js: ERROR no jQuery found!");
} else {

//use JQuery to bind event on each <th> with a "data-sortt" attribute
$('th').each(function() {
//console.log($(this));
if ($(this)[0].dataset.sortt) $(this).on('click', function(e) {
var data = $(this)[0].dataset.sortt
data = data.split(",");
sortt(data[0],data[1],data[2]);
});
});

//use JQuery to bind event on each <th> with a "data-sortt" attribute
$('th').each(function() {
if ($(this)[0].dataset.sortt) $(this).on('click', function(e) {
var data = $(this)[0].dataset.sortt
data = data.split(",");
sortt(data[0],data[1],data[2]);
});
});
}

//create global function with main routine