From ae60f10523864f5f347efc9084cf0a43f5804d02 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 18 Sep 2019 21:32:52 +0200 Subject: [PATCH] move data var so other routines also can use it --- sortt.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sortt.js b/sortt.js index e181ec2..75a4f0e 100644 --- a/sortt.js +++ b/sortt.js @@ -56,12 +56,15 @@ if(!window.jQuery) { $('th').each(function() { //if data attribute sortt is set if ($(this)[0].dataset.sortt) { + //get data + var data = $(this)[0].dataset.sortt; + data = data.split(","); + //add onclick event $(this).on('click', function() { - var data = $(this)[0].dataset.sortt; - data = data.split(","); sortt(data[0],data[1],data[2]); }); + //add arrow to colume // - place holder - }