Adds keyboard access to the finish linking phone button

This commit is contained in:
Josh Perez 2021-07-15 18:01:41 -04:00 committed by GitHub
parent f7c85432a5
commit ee4b79120e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 18 deletions

View File

@ -255,13 +255,13 @@
<span class='banner-icon lead-pencil'></span>
<div class='header'>{{ chooseName }}</div>
<div>
<input type='text' class='device-name' spellcheck='false' maxlength='50' />
<input type='text' class='device-name' spellcheck='false' maxlength='50' tabIndex="0" />
</div>
</div>
<div class='nav'>
<div>
<a class='button finish'>{{ finishLinkingPhoneButton }}</a>
<button class="button finish" type="submit" tabIndex="0">{{ finishLinkingPhoneButton }}</button>
</div>
</div>
</div>

View File

@ -29,7 +29,6 @@
events: {
'click .try-again': 'connect',
'click .second': 'shutdown',
'click .finish': 'finishLinking',
// the actual next step happens in confirmNumber() on submit form #link-phone
},
initialize(options = {}) {
@ -180,10 +179,6 @@
this.$(DEVICE_NAME_SELECTOR).val(deviceName || window.getHostName());
this.$(DEVICE_NAME_SELECTOR).focus();
},
finishLinking() {
// We use a form so we get submit-on-enter behavior
this.$('#link-phone').submit();
},
confirmNumber() {
const tsp = textsecure.storage.protocol;

View File

@ -237,13 +237,13 @@
<span class='banner-icon lead-pencil'></span>
<div class='header'>{{ chooseName }}</div>
<div>
<input type='text' class='device-name' spellcheck='false' maxlength='50' />
<input type='text' class='device-name' spellcheck='false' maxlength='50' tabIndex="0" />
</div>
</div>
<div class='nav'>
<div>
<a class='button finish'>{{ finishLinkingPhoneButton }}</a>
<button class="button finish" type="submit" tabIndex="0">{{ finishLinkingPhoneButton }}</button>
</div>
</div>
</div>

View File

@ -573,14 +573,6 @@
"updated": "2020-03-24T19:03:04.861Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
"line": " this.$('#link-phone').submit();",
"reasonCategory": "usageTrusted",
"updated": "2020-03-24T19:03:04.861Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
@ -14157,4 +14149,4 @@
"updated": "2021-03-18T21:41:28.361Z",
"reasonDetail": "A generic hook. Typically not to be used with non-DOM values."
}
]
]