Files
rainloop-webmail-mirror/dev/View/Popup/ViewOpenPgpKey.js
RainLoop Team 17669b7be0 es5 -> es2015 (last stage)
Signature plugin fixes
Add view decorator
A large number of fixes
2016-08-20 20:30:16 +03:00

57 lines
948 B
JavaScript

import ko from 'ko';
import key from 'key';
import {KeyState} from 'Common/Enums';
import {selectElement} from 'Common/Utils';
import {view, ViewType} from 'Knoin/Knoin';
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
@view({
name: 'View/Popup/ViewOpenPgpKey',
type: ViewType.Popup,
templateID: 'PopupsTwoFactorTest'
})
class ViewOpenPgpKeyPopupView extends AbstractViewNext
{
constructor() {
super();
this.key = ko.observable('');
this.keyDom = ko.observable(null);
this.sDefaultKeyScope = KeyState.PopupViewOpenPGP;
}
clearPopup() {
this.key('');
}
selectKey() {
const el = this.keyDom();
if (el)
{
selectElement(el);
}
}
onShow(oOpenPgpKey) {
this.clearPopup();
if (oOpenPgpKey)
{
this.key(oOpenPgpKey.armor);
}
}
onBuild() {
key('ctrl+a, command+a', KeyState.PopupViewOpenPGP, () => {
this.selectKey();
return false;
});
}
}
module.exports = ViewOpenPgpKeyPopupView;