mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
Added select ID text on click to gui
This commit is contained in:
parent
37a42dc408
commit
970a9c7552
@ -507,7 +507,7 @@
|
||||
<!-- ID modal -->
|
||||
|
||||
<modal id="idqr" large="yes" status="info" close="yes" icon="qrcode" title="{{'Device Identification' | translate}} — {{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>
|
||||
|
@ -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 one or more lines are too long
Loading…
Reference in New Issue
Block a user