mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Refactor dom initialize flag
This commit is contained in:
parent
5577c3ab5a
commit
0f404d2b25
@ -11,10 +11,10 @@
|
||||
ns.FramesListController = function (piskelController, container) {
|
||||
this.piskelController = piskelController;
|
||||
this.container = container;
|
||||
this.domInitialized = false;
|
||||
this.refreshZoom_();
|
||||
|
||||
this.redrawFlag = true;
|
||||
this.regenerateDomFlag = true;
|
||||
|
||||
this.cachedFrameProcessor = new pskl.model.frame.CachedFrameProcessor();
|
||||
this.cachedFrameProcessor.setFrameProcessor(this.frameToPreviewCanvas_.bind(this));
|
||||
@ -35,11 +35,11 @@
|
||||
this.updateScrollerOverflows();
|
||||
};
|
||||
|
||||
ns.FramesListController.prototype.flagForRedraw_ = function (reinitializeDom) {
|
||||
ns.FramesListController.prototype.flagForRedraw_ = function (regenerateDom) {
|
||||
this.redrawFlag = true;
|
||||
|
||||
if (reinitializeDom) {
|
||||
this.domInitialized = false;
|
||||
if (regenerateDom) {
|
||||
this.regenerateDomFlag = true;
|
||||
}
|
||||
};
|
||||
|
||||
@ -49,10 +49,12 @@
|
||||
|
||||
ns.FramesListController.prototype.render = function () {
|
||||
if (this.redrawFlag) {
|
||||
if (!this.domInitialized) {
|
||||
if (this.regenerateDomFlag) {
|
||||
this.tiles = [];
|
||||
this.addFrameTile = null;
|
||||
this.createPreviews_();
|
||||
|
||||
this.regenerateDomFlag = false;
|
||||
}
|
||||
|
||||
this.updatePreviews_();
|
||||
@ -177,7 +179,6 @@
|
||||
this.addFrameTile = newFrameButton;
|
||||
|
||||
this.updateScrollerOverflows();
|
||||
this.domInitialized = true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user