From 44d16d76c11fa54a837a8c14e110a366c6590d18 Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Wed, 12 Jun 2019 19:12:49 +0530 Subject: [PATCH] activity: Extract most js from realm_summary_table to activity.js. --- static/js/analytics/activity.js | 5 +++++ templates/analytics/realm_summary_table.html | 13 +------------ tools/webpack.assets.json | 1 + 3 files changed, 7 insertions(+), 12 deletions(-) create mode 100644 static/js/analytics/activity.js diff --git a/static/js/analytics/activity.js b/static/js/analytics/activity.js new file mode 100644 index 0000000000..fbc3c4e8f2 --- /dev/null +++ b/static/js/analytics/activity.js @@ -0,0 +1,5 @@ +$(function () { + $('a.envelope-link').click(function () { + common.copy_data_attribute_value($(this), "admin-emails"); + }); +}); diff --git a/templates/analytics/realm_summary_table.html b/templates/analytics/realm_summary_table.html index 67668826d6..43660e8890 100644 --- a/templates/analytics/realm_summary_table.html +++ b/templates/analytics/realm_summary_table.html @@ -6,17 +6,6 @@ var now = moment('{{ now }}'); $('#utctime')[0].innerHTML = moment.utc(now).format('YYYY-MM-DD HH:mm') + 'Z'; $('#localtime')[0].innerHTML = '(' + now.format('YYYY-MM-DD HH:mm ZZ') + ')'; - $(document).ready(function() { - $('a.envelope-link').click(function() { - var temp = $(document.createElement('input')); - $("body").append(temp); - temp.val($(this).data("value")).select(); - document.execCommand("copy"); - temp.remove(); - $(this).fadeOut(250); - $(this).fadeIn(1000); - }); - });