Skip to content

Commit 950bc0c

Browse files
committed
Select all text in URL bar on focus - closes #106
1 parent fbd55f4 commit 950bc0c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

services/views/js/app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ var App = {
2626
this.urlBar = document.getElementById('url-bar');
2727
this.messageArea = document.getElementById('message-area');
2828

29+
// Handle focus on URL bar
30+
this.urlBar.addEventListener('focus', this.handleFocus.bind(this));
31+
2932
// Handle submission of URL bar
3033
controls.addEventListener('submit', this.handleSubmit.bind(this));
3134
this.checkForPassword().then(()=> {
@@ -92,6 +95,16 @@ var App = {
9295
});
9396
},
9497

98+
/**
99+
* Handle focus on URL bar.
100+
*
101+
* @param {Event} e The focus event.
102+
*/
103+
handleFocus: function(e) {
104+
// Select all text
105+
this.urlBar.select();
106+
},
107+
95108
/**
96109
* Get the current URL displayed by the kiosk.
97110
*

0 commit comments

Comments
 (0)