Skip to content

Commit

Permalink
🐛 Fix missing aladinDiv argument to EventHandler constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Apr 24, 2024
1 parent 875984c commit bd89e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions js/models/event_handler.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import MessageHandler from "./message_handler";

export default class EventHandler {
constructor(A, aladin, model) {
constructor(A, aladin, aladinDiv, model) {
this.A = A;
this.aladin = aladin;
this.aladinDiv = aladinDiv;
this.model = model;
this.messageHandler = new MessageHandler(A, aladin);
}
Expand Down Expand Up @@ -77,7 +78,7 @@ export default class EventHandler {
/* Div control */
this.model.on("change:height", () => {
let height = this.model.get("height");
aladinDiv.style.height = `${height}px`;
this.aladinDiv.style.height = `${height}px`;
});

/* Aladin callbacks */
Expand Down
6 changes: 3 additions & 3 deletions js/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function initAladinLite(model, el) {
aladin.gotoRaDec(raDec[0], raDec[1]);

el.appendChild(aladinDiv);
return aladin;
return { aladin, aladinDiv };
}

async function initialize({ model }) {
Expand All @@ -43,9 +43,9 @@ function render({ model, el }) {
/* View -------------- */
/* ------------------- */

const aladin = initAladinLite(model, el);
const { aladin, aladinDiv } = initAladinLite(model, el);

const eventHandler = new EventHandler(A, aladin, model);
const eventHandler = new EventHandler(A, aladin, aladinDiv, model);
eventHandler.subscribeAll();

return () => {
Expand Down

0 comments on commit bd89e7f

Please sign in to comment.