Added select ID text on click to gui

This commit is contained in:
Daniel Bergmann
2015-07-01 15:44:23 +01:00
committed by Daniel Bergmann
parent 37a42dc408
commit 970a9c7552
3 changed files with 20 additions and 4 deletions

View File

@@ -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);
});
}
};
});