From a72b0c69e51d805aee8d3d63a1f3ca37d6453eab Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Sat, 6 May 2017 19:00:24 +0200 Subject: [PATCH] initialize insert-location frame-picker on show() --- .../dialogs/importwizard/steps/InsertLocation.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/js/controller/dialogs/importwizard/steps/InsertLocation.js b/src/js/controller/dialogs/importwizard/steps/InsertLocation.js index 83736b0..9528486 100644 --- a/src/js/controller/dialogs/importwizard/steps/InsertLocation.js +++ b/src/js/controller/dialogs/importwizard/steps/InsertLocation.js @@ -17,11 +17,6 @@ this.framePreview = this.container.querySelector('.insert-frame-preview'); this.currentPiskelFramePickerWidget = new pskl.widgets.FramePicker( this.piskelController.getPiskel(), this.framePreview); - this.currentPiskelFramePickerWidget.init(); - - var currentFrameIndex = this.piskelController.getCurrentFrameIndex(); - this.currentPiskelFramePickerWidget.setFrameIndex(currentFrameIndex + 1); - this.currentPiskelFramePickerWidget.setFirstFrameIndex(0); this.insertModeContainer = this.container.querySelector('.insert-mode-container'); this.addEventListener(this.insertModeContainer, 'change', this.onInsertModeChange_); @@ -40,7 +35,11 @@ }; ns.InsertLocation.prototype.onShow = function () { - // Nothing to do here! + this.currentPiskelFramePickerWidget.init(); + var currentFrameIndex = this.piskelController.getCurrentFrameIndex(); + this.currentPiskelFramePickerWidget.setFrameIndex(currentFrameIndex + 1); + this.currentPiskelFramePickerWidget.setFirstFrameIndex(0); + this.superclass.onShow.call(this); };