Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Evseev committed Oct 6, 2014
1 parent 7609501 commit b49b316
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,14 @@ canvas.renderers.container = function(element) {
*/
canvas.methods.updateLayout = function(apps, layout) {
var self = this;
var deferred = $.Deferred();
Echo.Utils.pipe($.Deferred().resolve(apps), [
return Echo.Utils.pipe($.Deferred().resolve(apps), [
$.proxy(this._loadAppResources, this),
$.proxy(this._initApps, this)
]).then(function() {
self.set("data.apps", apps);
self.set("data.layout", layout);
self.render();
deferred.resolve();
});
return deferred.promise();
};

canvas.methods._initApps = function(apps) {
Expand All @@ -356,7 +353,7 @@ canvas.methods._initApps = function(apps) {
acc[appId] = self.apps[appId];
}
});
return deferred.resolve().promise();
return deferred.resolve(apps).promise();
};

canvas.methods._initApp = function(data, id) {
Expand Down Expand Up @@ -518,7 +515,10 @@ canvas.methods._getAppScriptURL = function(config) {
};

canvas.methods._loadAppResources = function(apps) {
var self = this, resources = [], isManual = this._isManuallyConfigured(), deferred = $.Deferred();
var self = this;
var resources = [];
var isManual = this._isManuallyConfigured();
var deferred = $.Deferred();
$.map(apps, function(app) {
var script = self._getAppScriptURL(app);
if (!app.component || !script || !(isManual || app.id)) {
Expand Down

0 comments on commit b49b316

Please sign in to comment.