Skip to content

Commit

Permalink
rename get_last_child_id
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Jun 20, 2024
1 parent 485798e commit 8137e12
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/src/widget_ngl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,22 +941,22 @@ class NGLView extends widgets.DOMWidgetView{
}

async _downloadImage(filename, params) {
if (this.ngl_view_id == this.get_last_child_id()){
if (this.ngl_view_id == this._getLastChildId()){
const blob = await this.stage.makeImage(params);
NGL.download(blob, filename);
}
}

async _exportImage(wid, params) {
if (this.ngl_view_id == this.get_last_child_id()){
if (this.ngl_view_id == this._getLastChildId()){
const blob = await this.stage.makeImage(params);
this.processBlob(blob, "image_data", wid);
}
}

async handleMovieMaking(render_params) {
console.log('handleMovieMaking: render_params', render_params);
if (this.ngl_view_id == this.get_last_child_id()){
if (this.ngl_view_id == this._getLastChildId()){
const blob = await this.stage.makeImage(render_params);
this.processBlob(blob, "movie_image_data");
}
Expand Down Expand Up @@ -1017,14 +1017,14 @@ class NGLView extends widgets.DOMWidgetView{
}
}

get_last_child_id(){
_getLastChildId(){
var keys = this.model.get('_ngl_view_id')
return keys[keys.length-1]
}

async _handleStageLoadFile(msg){
// args = [{'type': ..., 'data': ...}]
if (this.ngl_view_id != this.get_last_child_id() && msg.last_child){
if (this.ngl_view_id != this._getLastChildId() && msg.last_child){
return
}
var o = await this._getLoadFilePromise(msg)
Expand Down

0 comments on commit 8137e12

Please sign in to comment.