Skip to content

Commit f09b0c0

Browse files
author
Lionel Laské
committed
Merge branch 'pr/1916' into dev
2 parents 22eff91 + 238e4ad commit f09b0c0

File tree

3 files changed

+699
-230
lines changed

3 files changed

+699
-230
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313
### Changed
1414
- Rewrite of Sugarizer Core using Vue.js
1515
- Allow de-coloring a country in Color My World #1890
16+
- Ability to resize images in Fototoon #1551
1617

1718
### Fixed
1819
- Bug in Jappy activity editor during initial rendering #1738

activities/Fototoon.activity/js/activity.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,26 @@ define(["sugar-web/activity/activity","sugar-web/datastore","sugar-web/env","tex
204204
};
205205
toonModel.showWait();
206206
if (editMode) {
207-
toonModel.initPreviews();
207+
// Wait for all previews to be generated before showing sort view
208+
toonModel.initPreviews(function(){;
208209
// resize the canvas
209210
sortCanvas.width = window.innerWidth - sugarCellSize * 2;
210211
var boxWidth = sortCanvas.width / toonModel.getData()['boxs'].length;
211212
sortCanvas.height = boxWidth * 3 / 4;
212213
sortCanvas.style.left = ((window.innerWidth - sortCanvas.width) / 2) + "px";
213214
sortCanvas.style.top = ((window.innerHeight - sortCanvas.height) / 2) + "px";
214215
toonModel.initSort(sortCanvas);
216+
toonModel.hideWait();
217+
// switch editMode
218+
editMode = !editMode;
219+
});
215220
} else {
216221
toonModel.finishSort();
217222
toonModel.init();
223+
toonModel.hideWait();
224+
// switch editMode
225+
editMode = ! editMode;
218226
};
219-
toonModel.hideWait();
220-
// switch editMode
221-
editMode = ! editMode;
222-
223227
});
224228

225229
var cleanAllButton = document.getElementById("clean-all-button");

0 commit comments

Comments
 (0)