From 0134077bd0d42a31758f212bf0f2dfd6d424ae26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 14 Sep 2021 09:56:12 +0300 Subject: [PATCH] Simplify JS --- static/js/profile.js | 7 ++----- static/js/project.js | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/static/js/profile.js b/static/js/profile.js index 374ff07d..e1719e9b 100644 --- a/static/js/profile.js +++ b/static/js/profile.js @@ -1,12 +1,9 @@ $(function() { $(".leave-project").click(function() { - var $this = $(this); - - $("#leave-project-name").text($this.data("name")); - $("#leave-project-code").val($this.data("code")); + $("#leave-project-name").text(this.dataset.name); + $("#leave-project-code").val(this.dataset.code); $('#leave-project-modal').modal("show"); - return false; }); diff --git a/static/js/project.js b/static/js/project.js index 7a765a94..e1d13421 100644 --- a/static/js/project.js +++ b/static/js/project.js @@ -1,10 +1,8 @@ $(function() { $(".member-remove").click(function() { - var $this = $(this); - - $("#rtm-email").text($this.data("email")); - $("#remove-team-member-email").val($this.data("email")); + $("#rtm-email").text(this.dataset.email); + $("#remove-team-member-email").val(this.dataset.email); $('#remove-team-member-modal').modal("show"); return false;