Flatten GUI tree somewhat
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.
This commit is contained in:
14
gui/syncthing/core/selectOnClickDirective.js
Normal file
14
gui/syncthing/core/selectOnClickDirective.js
Normal 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);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user