summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-07-06 18:22:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-08 09:57:29 +0100
commit8813726f1d5ea1d78fced7fe52abdf826e529e62 (patch)
tree073689032966641d0f12415002572de1f1d08e72 /bitbake/lib/toaster/toastergui/static/js/layerdetails.js
parente1ba2fd331b7f937b8ddf3e83389df5caf33d9e8 (diff)
downloadpoky-8813726f1d5ea1d78fced7fe52abdf826e529e62.tar.gz
bitbake: toaster: add Layer delete front end feature to layerdetails
Add the front end feature to delete a layer from the layer details page. [YOCO #9184] (Bitbake rev: 91815229f60eb9deba7d299f05c69b52ff1df59c) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/layerdetails.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/layerdetails.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
index a56087b738..683486e53b 100644
--- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -397,6 +397,26 @@ function layerDetailsPageInit (ctx) {
397 $(this).parents("form").submit(); 397 $(this).parents("form").submit();
398 }); 398 });
399 399
400 $("#layer-delete-confirmed").click(function(){
401 $.cookie("layer-deleted", ctx.layerVersion.name, { path: '/'});
402
403 $.ajax({
404 type: "DELETE",
405 url: ctx.xhrUpdateLayerUrl,
406 headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
407 success: function(data) {
408 if (data.error != "ok") {
409 console.warn(data.error);
410 } else {
411 window.location = data.redirect + "?notify=layer-deleted";
412 }
413 },
414 error: function(data) {
415 console.warn("Call failed");
416 console.warn(data);
417 }
418 });
419 });
400 420
401 layerDepsList.find(".glyphicon-trash").click(layerDepRemoveClick); 421 layerDepsList.find(".glyphicon-trash").click(layerDepRemoveClick);
402 layerDepsList.find("a").tooltip(); 422 layerDepsList.find("a").tooltip();