Commit 91c789e9 authored by Romain Courteaud's avatar Romain Courteaud

Release version 0.5.1

parent 812510cb
This diff is collapsed.
This diff is collapsed.
...@@ -766,6 +766,13 @@ ...@@ -766,6 +766,13 @@
if (options.element === undefined) { if (options.element === undefined) {
options.element = document.createElement("div"); options.element = document.createElement("div");
} }
function loadDependency(method, url) {
return function () {
return method(url);
};
}
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return renderJS.declareGadgetKlass(url); return renderJS.declareGadgetKlass(url);
...@@ -790,17 +797,17 @@ ...@@ -790,17 +797,17 @@
}) })
// Load all JS/CSS // Load all JS/CSS
.push(function (all_list) { .push(function (all_list) {
var parameter_list = [], var q = new RSVP.Queue(),
i; i;
// Load JS // Load JS
for (i = 0; i < all_list[0].length; i += 1) { for (i = 0; i < all_list[0].length; i += 1) {
parameter_list.push(renderJS.declareJS(all_list[0][i])); q.push(loadDependency(renderJS.declareJS, all_list[0][i]));
} }
// Load CSS // Load CSS
for (i = 0; i < all_list[1].length; i += 1) { for (i = 0; i < all_list[1].length; i += 1) {
parameter_list.push(renderJS.declareCSS(all_list[1][i])); q.push(loadDependency(renderJS.declareCSS, all_list[1][i]));
} }
return RSVP.all(parameter_list); return q;
}) })
.push(function () { .push(function () {
return gadget_instance; return gadget_instance;
...@@ -1354,9 +1361,9 @@ ...@@ -1354,9 +1361,9 @@
queue.push(ready_wrapper); queue.push(ready_wrapper);
for (i = 0; i < tmp_constructor.ready_list.length; i += 1) { for (i = 0; i < tmp_constructor.ready_list.length; i += 1) {
// Put a timeout? // Put a timeout?
queue.push(tmp_constructor.ready_list[i]); queue.push(tmp_constructor.ready_list[i])
// Always return the gadget instance after ready function // Always return the gadget instance after ready function
queue.push(ready_wrapper); .push(ready_wrapper);
} }
queue.push(resolve, function (e) { queue.push(resolve, function (e) {
reject(e); reject(e);
......
This diff is collapsed.
{ {
"name": "renderjs", "name": "renderjs",
"version": "0.5.0", "version": "0.5.1",
"description": "RenderJs provides HTML5 gadgets", "description": "RenderJs provides HTML5 gadgets",
"main": "dist/renderjs-latest.js", "main": "dist/renderjs-latest.js",
"dependencies": { "dependencies": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment