Browse Source

Added select ID text on click to gui

Daniel Bergmann 10 years ago
parent
commit
970a9c7552

+ 2 - 1
gui/index.html

@@ -507,7 +507,7 @@
   <!-- ID modal -->
 
   <modal id="idqr" large="yes" status="info" close="yes" icon="qrcode" title="{{'Device Identification' | translate}} &mdash; {{deviceName(thisDevice())}}">
-    <div class="well well-sm text-monospace text-center">{{myID}}</div>
+    <div select-on-click class="well well-sm text-monospace text-center">{{myID}}</div>
     <img ng-if="myID" class="center-block img-thumbnail" ng-src="qr/?text={{myID}}"/>
   </modal>
 
@@ -1167,6 +1167,7 @@
   <script src="scripts/syncthing/core/directives/uniqueFolderDirective.js"></script>
   <script src="scripts/syncthing/core/directives/validDeviceidDirective.js"></script>
   <script src="scripts/syncthing/core/directives/popoverDirective.js"></script>
+  <script src="scripts/syncthing/core/directives/selectOnClickDirective.js"></script>
   <script src="scripts/syncthing/core/filters/alwaysNumberFilter.js"></script>
   <script src="scripts/syncthing/core/filters/basenameFilter.js"></script>
   <script src="scripts/syncthing/core/filters/binaryFilter.js"></script>

+ 14 - 0
gui/scripts/syncthing/core/directives/selectOnClickDirective.js

@@ -0,0 +1,14 @@
+angular.module('syncthing.core')
+    .directive('selectOnClick', function ($window) {
+        return {
+            link: function (scope, element, attrs) {
+                element.on('click', function() {
+                    var selection = $window.getSelection();
+                    var range = document.createRange();
+                    range.selectNodeContents(element[0]);
+                    selection.removeAllRanges();
+                    selection.addRange(range);
+                });
+            }
+        };
+});

File diff suppressed because it is too large
+ 2 - 2
internal/auto/gui.files.go


Some files were not shown because too many files changed in this diff