From bef5f1796b3ac891a246c83ace0b2854d9e8a6c6 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Fri, 9 Aug 2019 00:35:29 -0400 Subject: [PATCH] Fix broken buttons by not hijacking click event without data-href attribute (#1081) * Fix broken buttons by not hijacking click event without `data-href` attribute --- CTFd/themes/admin/static/js/style.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CTFd/themes/admin/static/js/style.js b/CTFd/themes/admin/static/js/style.js index 541cc868..324a73b7 100644 --- a/CTFd/themes/admin/static/js/style.js +++ b/CTFd/themes/admin/static/js/style.js @@ -24,7 +24,7 @@ $(function() { } }); - $("tr").click(function() { + $("tr[data-href]").click(function() { var sel = getSelection().toString(); if (!sel) { var href = $(this).attr("data-href"); @@ -35,7 +35,7 @@ $(function() { return false; }); - $("tr a, button").click(function(e) { + $("tr[data-href] a, tr[data-href] button").click(function(e) { // TODO: This is a hack to allow modal close buttons to work if (!$(this).attr("data-dismiss")) { e.stopPropagation();