code format
This commit is contained in:
parent
4e68338082
commit
ff002275ca
23
sortt.js
23
sortt.js
@ -4,27 +4,24 @@
|
|||||||
@License MIT
|
@License MIT
|
||||||
@Author 6543
|
@Author 6543
|
||||||
@Repository https://gitea.com/6543/gitea_sortt
|
@Repository https://gitea.com/6543/gitea_sortt
|
||||||
@Version 1.1
|
@Version 1.2
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// test if jQuery is available
|
// test if jQuery is available
|
||||||
if(!window.jQuery)
|
if(!window.jQuery) {
|
||||||
{
|
|
||||||
console.log("sortt.js: ERROR no jQuery found!");
|
console.log("sortt.js: ERROR no jQuery found!");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//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() {
|
||||||
//console.log($(this));
|
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]);
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//create global function with main routine
|
//create global function with main routine
|
||||||
|
Reference in New Issue
Block a user