From 33d2b87aca667d72262a3928deaf35414b46a7c1 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Mon, 8 Jun 2015 15:22:01 +0100 Subject: toastergui: remove xhr_datatypeahaed layerdeps call This patch removes the url-constructing calls to get the layer details in favor of embedding the look-up URL in the JSON data on the layer list page. This allows further removal of the XHR-specific code for layer dependencies in favor of REST calls to layer details data. Signed-off-by: Alexandru DAMIAN --- lib/toaster/toastergui/static/js/importlayer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/toaster/toastergui/static/js/importlayer.js') diff --git a/lib/toaster/toastergui/static/js/importlayer.js b/lib/toaster/toastergui/static/js/importlayer.js index e1fc5c518..e9d7ae8ef 100644 --- a/lib/toaster/toastergui/static/js/importlayer.js +++ b/lib/toaster/toastergui/static/js/importlayer.js @@ -48,7 +48,7 @@ function importLayerPageInit (ctx) { newLayerDep.children("span").tooltip(); var link = newLayerDep.children("a"); - link.attr("href", ctx.layerDetailsUrl+String(currentLayerDepSelection.id)); + link.attr("href", currentLayerDepSelection.layerDetailsUrl); link.text(currentLayerDepSelection.name); link.tooltip({title: currentLayerDepSelection.tooltip, placement: "right"}); @@ -63,11 +63,11 @@ function importLayerPageInit (ctx) { $("#layer-deps-list").append(newLayerDep); - libtoaster.getLayerDepsForProject(libtoaster.ctx.projectId, currentLayerDepSelection.id, function (data){ + libtoaster.getLayerDepsForProject(currentLayerDepSelection.layerDetailsUrl, function (data){ /* These are the dependencies of the layer added as a dependency */ if (data.list.length > 0) { - currentLayerDepSelection.url = ctx.layerDetailsUrl+currentLayerDepSelection.id; - layerDeps[currentLayerDepSelection.id].deps = data.list + currentLayerDepSelection.url = currentLayerDepSelection.layerDetailsUrl; + layerDeps[currentLayerDepSelection.id].deps = data.list; } /* Clear the current selection */ -- cgit 1.2.3-korg