mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-15 04:22:03 +08:00
22 lines
No EOL
488 B
JavaScript
22 lines
No EOL
488 B
JavaScript
'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)
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}]); |