mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 14:58:26 +00:00
15 lines
529 B
JavaScript
15 lines
529 B
JavaScript
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);
|
|
});
|
|
}
|
|
};
|
|
});
|