From 2f2f0e4a878d4b4f0c2175ed1fe8cfdd56dd172f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 12 Mar 2014 15:30:31 +0100 Subject: [PATCH] Feature #2746: Fix remove buttons in template wizard --- src/sunstone/public/js/plugins/templates-tab.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index da7ef36004..ffafcd10cd 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -1899,8 +1899,8 @@ function add_disks_tab(dialog) { $( "#storageTab i.remove-tab" ).live( "click", function() { var target = $(this).parent().attr("href"); var dd = $(this).closest('dd'); - var dl = $(this).closest('.tabs-content'); - var content = $(target + 'Tab'); + var dl = $(this).closest('dl'); + var content = $(target); dd.remove(); content.remove(); @@ -1962,8 +1962,8 @@ function add_nics_tab(dialog) { $( "#networkTab i.remove-tab" ).live( "click", function() { var target = $(this).parent().attr("href"); var dd = $(this).closest('dd'); - var dl = $(this).closest('.tabs-content'); - var content = $(target + 'Tab'); + var dl = $(this).closest('dl'); + var content = $(target); dd.remove(); content.remove(); @@ -2680,7 +2680,8 @@ function add_ioTab(dialog) { cell3.innerHTML = ""; }); - $( "#ioTab i.remove-tab", dialog).live( "click", function() { + $(document).off('click', "#ioTab i.remove-tab"); + $(document).on('click', "#ioTab i.remove-tab", function(){ $(this).closest("tr").remove() }); }