mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
FS-8026 [Verto-Communicator] #resolve Add an autofocus directive to both dialpad and login so that enter will just work. On dialpad useful to provide keyboard only input without the need to using the mouse.
This commit is contained in:
@@ -85,3 +85,25 @@ vertoDirectives.directive('showControls',
|
||||
link: link
|
||||
};
|
||||
});
|
||||
|
||||
/*
|
||||
Sometimes autofocus HTML5 directive just isn't enough with SPAs.
|
||||
This directive will force autofocus to work properly under those circumstances.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
vertoDirectives.directive('autofocus', ['$timeout',
|
||||
function ($timeout) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, $element) {
|
||||
$timeout(function () {
|
||||
console.log('Focusing...');
|
||||
$element[0].focus();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
})();
|
Reference in New Issue
Block a user