1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-20 06:56:40 +02:00

Add tooltip to password hiding button

This commit is contained in:
Grant Moyer 2019-08-05 22:19:20 -04:00
parent a2a5d6d10a
commit ebcbe6496a
2 changed files with 10 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const CopyPaste = require('../comp/copy-paste');
const AppSettingsModel = require('../models/app-settings-model');
const GeneratorPresets = require('../comp/generator-presets');
const Locale = require('../util/locale');
const Tip = require('../util/tip');
const GeneratorView = Backbone.View.extend({
el: 'body',
@ -124,6 +125,8 @@ const GeneratorView = Backbone.View.extend({
this.hide = e.target.checked;
AppSettingsModel.instance.unset('generatorHide', { silent: true });
AppSettingsModel.instance.set('generatorHide', this.hide);
const label = this.$el.find('#gen__check-hide + label');
Tip.createTip(label[0], {title: this.hide ? Locale.genShowPass : Locale.genHidePass});
this.showPassword();
},

View File

@ -28,7 +28,13 @@
<div class="gen__result-wrap">
<div class="gen__result"></div>
<input type="checkbox" id="gen__check-hide" {{#if hide}}checked{{/if}}>
<label for="gen__check-hide"></label>
<label for="gen__check-hide"
{{#if hide}}
title="{{res 'genShowPass'}}"
{{else}}
title="{{res 'genHidePass'}}"
{{/if}}
></label>
</div>
<div class="gen__btn-wrap"><button class="gen__btn-ok">{{btnTitle}}</button></div>
</div>