grim/port-authority
Clone
Summary
Browse
Changes
Graph
automatically select the tag then you click on it
develop
2015-04-08, Gary Kramlich
d97c2da13228
Parents
fd3b4f93c3d4
Children
192402859c30
64b90cc92af6
automatically select the tag then you click on it
2 files changed, 12 insertions(+), 1 deletions(-)
+1
-1
html/window.html
+11
-0
js/app.js
--- a/html/window.html Thu Mar 19 17:49:53 2015 -0500
+++ b/html/window.html Wed Apr 08 14:57:50 2015 -0500
@@ -53,7 +53,7 @@
<div class="ui icon message yellow">
<div class="content">
<i class="icon copy"></i>
- {{clipboard}}
+ <span class="clipboard" ng-click="set_clipboard()">{{clipboard}}</span>
</div>
</div>
</div>
--- a/js/app.js Thu Mar 19 17:49:53 2015 -0500
+++ b/js/app.js Wed Apr 08 14:57:50 2015 -0500
@@ -204,4 +204,15 @@
$scope.clear_error = function() {
$scope.error = null;
};
+
+ $scope.set_clipboard = function() {
+ var element = document.querySelector(".clipboard");
+ var selection = window.getSelection();
+ var range = document.createRange();
+
+ range.selectNodeContents(element);
+
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
}