mirror of https://github.com/keeweb/keeweb.git
fix copy tip hide
This commit is contained in:
parent
1459f547fd
commit
c17b711a2e
|
@ -70,6 +70,7 @@ var DetailsView = Backbone.View.extend({
|
||||||
this.listenTo(Backbone, 'auto-type', this.autoTypeGlobal);
|
this.listenTo(Backbone, 'auto-type', this.autoTypeGlobal);
|
||||||
this.listenTo(Backbone, 'copy-user', this.copyUserName);
|
this.listenTo(Backbone, 'copy-user', this.copyUserName);
|
||||||
this.listenTo(Backbone, 'copy-url', this.copyUrl);
|
this.listenTo(Backbone, 'copy-url', this.copyUrl);
|
||||||
|
this.listenTo(Backbone, 'toggle-settings', this.settingsToggled);
|
||||||
this.listenTo(OtpQrReqder, 'qr-read', this.otpCodeRead);
|
this.listenTo(OtpQrReqder, 'qr-read', this.otpCodeRead);
|
||||||
this.listenTo(OtpQrReqder, 'enter-manually', this.otpEnterManually);
|
this.listenTo(OtpQrReqder, 'enter-manually', this.otpEnterManually);
|
||||||
KeyHandler.onKey(Keys.DOM_VK_C, this.copyPassword, this, KeyHandler.SHORTCUT_ACTION, false, true);
|
KeyHandler.onKey(Keys.DOM_VK_C, this.copyPassword, this, KeyHandler.SHORTCUT_ACTION, false, true);
|
||||||
|
@ -93,10 +94,7 @@ var DetailsView = Backbone.View.extend({
|
||||||
removeFieldViews: function() {
|
removeFieldViews: function() {
|
||||||
this.fieldViews.forEach(function(fieldView) { fieldView.remove(); });
|
this.fieldViews.forEach(function(fieldView) { fieldView.remove(); });
|
||||||
this.fieldViews = [];
|
this.fieldViews = [];
|
||||||
if (this.fieldCopyTip) {
|
this.hideFieldCopyTip();
|
||||||
this.fieldCopyTip.hide();
|
|
||||||
this.fieldCopyTip = null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
|
@ -449,6 +447,17 @@ var DetailsView = Backbone.View.extend({
|
||||||
setTimeout(function() { tip.hide(); }, Timeouts.AutoHideHint);
|
setTimeout(function() { tip.hide(); }, Timeouts.AutoHideHint);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hideFieldCopyTip: function() {
|
||||||
|
if (this.fieldCopyTip) {
|
||||||
|
this.fieldCopyTip.hide();
|
||||||
|
this.fieldCopyTip = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
settingsToggled: function() {
|
||||||
|
this.hideFieldCopyTip();
|
||||||
|
},
|
||||||
|
|
||||||
fieldChanged: function(e) {
|
fieldChanged: function(e) {
|
||||||
if (e.field) {
|
if (e.field) {
|
||||||
if (e.field[0] === '$') {
|
if (e.field[0] === '$') {
|
||||||
|
@ -526,10 +535,7 @@ var DetailsView = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
fieldCopied: function(e) {
|
fieldCopied: function(e) {
|
||||||
if (this.fieldCopyTip) {
|
this.hideFieldCopyTip();
|
||||||
this.fieldCopyTip.hide();
|
|
||||||
this.fieldCopyTip = null;
|
|
||||||
}
|
|
||||||
var fieldLabel = e.source.labelEl;
|
var fieldLabel = e.source.labelEl;
|
||||||
var clipboardTime = e.copyRes.seconds;
|
var clipboardTime = e.copyRes.seconds;
|
||||||
var msg = clipboardTime ? Locale.detFieldCopiedTime.replace('{}', clipboardTime)
|
var msg = clipboardTime ? Locale.detFieldCopiedTime.replace('{}', clipboardTime)
|
||||||
|
|
Loading…
Reference in New Issue