2020-01-14 21:52:18 +01:00
|
|
|
import protectedSessionService from '../../services/protected_session.js';
|
2019-05-05 19:48:30 +02:00
|
|
|
|
|
|
|
class NoteDetailProtectedSession {
|
2019-05-05 18:24:59 +02:00
|
|
|
/**
|
2019-05-08 19:55:24 +02:00
|
|
|
* @param {TabContext} ctx
|
2019-05-05 18:24:59 +02:00
|
|
|
*/
|
|
|
|
constructor(ctx) {
|
|
|
|
this.ctx = ctx;
|
2019-05-08 19:55:24 +02:00
|
|
|
this.$component = ctx.$tabContent.find(".protected-session-password-component");
|
|
|
|
this.$passwordForm = ctx.$tabContent.find(".protected-session-password-form");
|
|
|
|
this.$passwordInput = ctx.$tabContent.find(".protected-session-password");
|
2019-05-05 19:48:30 +02:00
|
|
|
|
2019-11-09 17:45:22 +01:00
|
|
|
this.$passwordForm.on('submit', () => {
|
2019-05-05 19:48:30 +02:00
|
|
|
const password = this.$passwordInput.val();
|
|
|
|
this.$passwordInput.val("");
|
|
|
|
|
|
|
|
protectedSessionService.setupProtectedSession(password);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
2019-05-05 18:24:59 +02:00
|
|
|
}
|
|
|
|
|
2019-05-12 12:58:55 +02:00
|
|
|
render() {
|
2019-05-05 18:24:59 +02:00
|
|
|
this.$component.show();
|
|
|
|
}
|
2019-05-05 19:48:30 +02:00
|
|
|
|
2019-08-25 19:11:42 +02:00
|
|
|
show() {}
|
|
|
|
|
2019-05-05 19:48:30 +02:00
|
|
|
getContent() {}
|
|
|
|
|
|
|
|
focus() {}
|
|
|
|
|
|
|
|
onNoteChange() {}
|
|
|
|
|
|
|
|
cleanup() {}
|
|
|
|
|
|
|
|
scrollToTop() {
|
|
|
|
this.$component.scrollTop(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default NoteDetailProtectedSession;
|