diff --git a/ipyaladin/aladin_widget.py b/ipyaladin/aladin_widget.py index 7e45d107..c46fa894 100644 --- a/ipyaladin/aladin_widget.py +++ b/ipyaladin/aladin_widget.py @@ -172,16 +172,6 @@ def __init__(self, **kwargs): # see: http://jupyter-notebook.readthedocs.io/en/latest/comms.html self.on_msg(self.handle_aladin_event) - @observe("height") - def _immutable_height(self, change): - """Inform the users that height is immutable outside of instantiation. - """ - # change["old"] is None when doing the instantiation, and has an other value - # at every other times - if change["old"] != None: - raise UserWarning("height cannot be changed outside of the instantiation" - " of an Aladin() object.") - # Note: (about the classe's functions) # As it is only possible to communicate with the js side of the application by using traitlets, # we can not directly call a js function from the python side diff --git a/js/lib/jupyter-aladin.js b/js/lib/jupyter-aladin.js index 5883ce41..a0087443 100644 --- a/js/lib/jupyter-aladin.js +++ b/js/lib/jupyter-aladin.js @@ -184,6 +184,10 @@ export class AladinView extends DOMWidgetView { this.listenTo(this.model, 'change:coo_frame', () => { this.al.setFrame(this.model.get('coo_frame')); }, this); + this.listenTo(this.model, 'change:height', () => { + let height = this.model.get('height'); + this.div.setAttribute("style","width:100%;height:" + height + "px;"); + }, this); this.listenTo(this.model, 'change:survey', () => { this.al.setImageSurvey(this.model.get('survey')); }, this);