The very deep tree structure didn't really aggree with me, sorry. This makes the core module rather large, but on the other hand that just highlights that it is rather large.
15 lines
524 B
JavaScript
15 lines
524 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);
|
|
});
|
|
}
|
|
};
|
|
});
|