Selaa lähdekoodia

Generate password when hitting Enter

fix https://github.com/lesspass/lesspass/issues/141
pull/342/head
Guillaume Vincent 7 vuotta sitten
vanhempi
commit
7343d66f02
2 muutettua tiedostoa jossa 16 lisäystä ja 6 poistoa
  1. +9
    -3
      src/components/MasterPassword.vue
  2. +7
    -3
      src/views/PasswordGenerator.vue

+ 9
- 3
src/components/MasterPassword.vue Näytä tiedosto

@@ -12,7 +12,8 @@
autocorrect="off"
autocapitalize="off"
v-model="password"
v-on:input="updatePassword($event.target.value)">
v-on:input="updatePassword($event.target.value)"
v-on:keyup.enter="triggerEnterMethod">
<fingerprint v-bind:fingerprint="fingerprint" v-on:click.native="togglePasswordType($refs.password)">
</fingerprint>
</div>
@@ -23,9 +24,9 @@

export default {
components: {
Fingerprint,
Fingerprint
},
props: ['value'],
props: ['value', 'keyupEnter'],
data(){
return {
fingerprint: '',
@@ -53,6 +54,11 @@
} else {
element.type = 'password';
}
},
triggerEnterMethod(){
if (typeof this.keyupEnter !== undefined) {
this.keyupEnter()
}
}
}
}


+ 7
- 3
src/views/PasswordGenerator.vue Näytä tiedosto

@@ -71,7 +71,7 @@
</div>
</div>
<div class="form-group">
<master-password v-model="masterPassword"></master-password>
<master-password v-model="masterPassword" :keyupEnter="generatePassword"></master-password>
</div>
<div class="form-group row">
<div class="col-9" v-show="generatedPassword">
@@ -140,7 +140,9 @@
</div>
<div class="form-group row" v-if="showOptions">
<div class="col-6 col-sm-4">
<label for="passwordLength"><small>Length</small></label>
<label for="passwordLength">
<small>Length</small>
</label>
<div class="input-group input-group-sm">
<span class="input-group-btn" v-on:click.prevent="decrementPasswordLength">
<button class="btn btn-secondary" type="button" tabindex="-1">
@@ -157,7 +159,9 @@
</div>
</div>
<div class="col-6 col-sm-4">
<label for="passwordCounter"><small>Counter</small></label>
<label for="passwordCounter">
<small>Counter</small>
</label>
<div class="input-group input-group-sm">
<span class="input-group-btn" v-on:click.prevent="decrementCounter">
<button class="btn btn-secondary" type="button" tabindex="-1">


Ladataan…
Peruuta
Tallenna