From d37b95cb71d32d4483190609798e244c331db165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Thu, 6 Jul 2017 01:49:52 -0300 Subject: [PATCH] Prevent link action with scripts Required for the theme change that changes the buttons to `a` tags. --- public/src/app.js | 3 ++- public/src/client/topic/postTools.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index ccd324b68c..3af44ae109 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -35,7 +35,8 @@ app.cacheBuster = null; app.handleSearch(); } - $('body').on('click', '#new_topic', function () { + $('body').on('click', '#new_topic', function (e) { + e.preventDefault(); app.newTopic(); }); diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index 707a9a5b0f..0834e2b27a 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -85,7 +85,8 @@ define('forum/topic/postTools', [ onReplyClicked($(this), tid); }); - $('.topic').on('click', '[component="topic/reply"]', function () { + $('.topic').on('click', '[component="topic/reply"]', function (e) { + e.preventDefault(); onReplyClicked($(this), tid); });