mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-27 17:04:43 +08:00
23 lines
No EOL
530 B
JavaScript
23 lines
No EOL
530 B
JavaScript
(function () {
|
|
'use strict';
|
|
/**
|
|
* @ngdoc directive
|
|
* @name passmanApp.directive:selectOnClick
|
|
* @description
|
|
* # selectOnClick
|
|
*/
|
|
angular.module('passmanApp')
|
|
.directive('selectOnClick', ['$window', function ($window) {
|
|
return {
|
|
restrict: 'A',
|
|
link: function (scope, element, attrs) {
|
|
element.on('click', function () {
|
|
if (!$window.getSelection().toString()) {
|
|
// Required for mobile Safari
|
|
this.setSelectionRange(0, this.value.length);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}]);
|
|
}()); |