Skip to content

Commit 444ffc5

Browse files
committed
load order fix
1 parent 956653c commit 444ffc5

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test/browser_test.html

+8-9
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,19 @@ <h1 class="left">Colorgram
185185
}
186186

187187
function processImage(imagePath, prepend) {
188+
var element = document.createElement('div');
189+
190+
if (prepend) {
191+
root.insertBefore(element, root.children[1]);
192+
} else {
193+
root.appendChild(element);
194+
}
195+
188196
loadImage(imagePath, function (img) {
189197
var start = new Date().getTime();
190198
var stats = Colorgram.extract(img);
191199
var elapsed = new Date().getTime() - start;
192-
var element = document.createElement('div');
193-
194-
if (prepend) {
195-
root.insertBefore(element, root.children[1]);
196-
} else {
197-
root.appendChild(element);
198-
}
199-
200200
element.className = 'block';
201-
202201
element.appendChild(img.canvas);
203202
element.appendChild(statsImage(stats, false));
204203
element.appendChild(statsImage(Colorgram.sortByHsl(stats), true));

0 commit comments

Comments
 (0)