mirror of https://github.com/keeweb/keeweb.git
fix #750: prevent undo at login
This commit is contained in:
parent
42bea50907
commit
08fbb9bf79
|
@ -5,6 +5,7 @@ const Keys = require('../const/keys');
|
|||
const Alerts = require('../comp/alerts');
|
||||
const SecureInput = require('../comp/secure-input');
|
||||
const DropboxChooser = require('../comp/dropbox-chooser');
|
||||
const KeyHandler = require('../comp/key-handler');
|
||||
const StorageFileListView = require('../views/storage-file-list-view');
|
||||
const FeatureDetector = require('../util/feature-detector');
|
||||
const Logger = require('../util/logger');
|
||||
|
@ -61,6 +62,7 @@ const OpenView = Backbone.View.extend({
|
|||
rev: null
|
||||
};
|
||||
this.passwordInput = new SecureInput();
|
||||
KeyHandler.onKey(Keys.DOM_VK_Z, this.undoKeyPress, this, KeyHandler.SHORTCUT_ACTION);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
|
@ -133,6 +135,7 @@ const OpenView = Backbone.View.extend({
|
|||
|
||||
remove: function() {
|
||||
this.passwordInput.reset();
|
||||
KeyHandler.offKey(Keys.DOM_VK_Z, this.undoKeyPress, this);
|
||||
Backbone.View.prototype.remove.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
@ -466,6 +469,10 @@ const OpenView = Backbone.View.extend({
|
|||
}
|
||||
},
|
||||
|
||||
undoKeyPress: function(e) {
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
showOpenFileInfo: function(fileInfo) {
|
||||
if (this.busy || !fileInfo) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue