From 7cf448206c7cfeb6bb7c97bde4418abb1b3e613b Mon Sep 17 00:00:00 2001 From: Martin Harris Date: Mon, 27 Jul 2015 09:18:27 +0100 Subject: [PATCH] Uses text() rather than html() when copying to clipboard --- usage/jsgui/src/main/webapp/assets/js/view/entity-config.js | 4 ++-- usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js index befd9f25df..f517bcb396 100644 --- a/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js +++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js @@ -180,11 +180,11 @@ define([ // the zeroClipboard instance is a singleton so check our scope first if (!$(this).closest("#config-table").length) return; var text = $(this).attr('copy-value'); - if (!text) text = $(this).closest('.floatGroup').find('.value').html(); + if (!text) text = $(this).closest('.floatGroup').find('.value').text(); // log("Copying config text '"+text+"' to clipboard"); client.setText(text); - + // show the word "copied" for feedback; // NB this occurs on mousedown, due to how flash plugin works // (same style of feedback and interaction as github) diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js index 7fbf90e6fa..282c62287c 100644 --- a/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js +++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js @@ -188,8 +188,8 @@ define([ // the zeroClipboard instance is a singleton so check our scope first if (!$(this).closest("#sensors-table").length) return; var text = $(this).attr('copy-value'); - if (!text) text = $(this).closest('.floatGroup').find('.value').html(); - + if (!text) text = $(this).closest('.floatGroup').find('.value').text(); + // log("Copying sensors text '"+text+"' to clipboard"); client.setText(text);