From 98d168abc4f9b850b3275e8a35ceb1383cf5a5eb Mon Sep 17 00:00:00 2001 From: ovclas Date: Tue, 11 Oct 2011 01:06:37 +0000 Subject: [PATCH] issue 372 edit menu in site map, old menu info remains in edit form this bug fixed git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9548 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/menu/tpl/js/sitemap.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/menu/tpl/js/sitemap.js b/modules/menu/tpl/js/sitemap.js index 5211aaf89..5d1a7daa3 100644 --- a/modules/menu/tpl/js/sitemap.js +++ b/modules/menu/tpl/js/sitemap.js @@ -21,6 +21,7 @@ $('form.siteMap') var menuUrl = null; $('a._edit').click(function(){ + resetEditForm(); var itemKey = $(this).parent().prevAll('._item_key').val(); menuSrl = $(this).parents().prevAll('input[name=menu_srl]').val(); menuForm = $('#menu_'+menuSrl); @@ -103,15 +104,14 @@ $('form.siteMap') var createModuleLayer = $('#createModule'); var selectModuleLayer = $('#selectModule'); var insertUrlLayer = $('#insertUrl'); - kindModuleLayer.hide(); - createModuleLayer.hide(); - selectModuleLayer.hide(); - insertUrlLayer.hide(); - $('a._add').click(function() + function resetEditForm() { - editForm.find('.h2').html('Add Menu'); - editForm.find('input[name=menu_srl]').val($(this).parents().prevAll('input[name=menu_srl]').val()); + kindModuleLayer.hide(); + createModuleLayer.hide() + selectModuleLayer.hide() + insertUrlLayer.hide() + editForm.find('input[name=menu_item_srl]').val(''); editForm.find('input[name=parent_srl]').val(0); editForm.find('input[name=menu_name]').val(''); @@ -121,6 +121,13 @@ $('form.siteMap') editForm.find('input=[name=menu_url]').val(''); editForm.find('input=[name=menu_open_window]')[0].checked = true; editForm.find('input=[name=group_srls\\[\\]]').attr('checked', false); + } + + $('a._add').click(function() + { + editForm.find('.h2').html('Add Menu'); + editForm.find('input[name=menu_srl]').val($(this).parents().prevAll('input[name=menu_srl]').val()); + resetEditForm(); }); $('input._typeCheck').click(typeCheck);