From 427a05d328fccc99a9339dbc6c933281eaaaa3b9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 27 Aug 2012 19:53:17 +0200 Subject: Work on form panel --- static/saclay/js/interface.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 static/saclay/js/interface.js (limited to 'static/saclay/js/interface.js') diff --git a/static/saclay/js/interface.js b/static/saclay/js/interface.js new file mode 100644 index 0000000..5a1c061 --- /dev/null +++ b/static/saclay/js/interface.js @@ -0,0 +1,40 @@ +$(function(){ + var _frm_editmarker_initialized; + var _frm_editroute_initialized; + var _frm_editevent_initialized; + + var update_editmarker = function(){ + $.ajax({url: edit_url, + dataType: "html", + success: function (data) { + $('#frm-edit-marker').html(data); + }, + error: function (data) { + $('#frm-edit-marker').html("

"+ + default_error_message+"

"); + } + }); + }; + + $("#action-carte").click(function(){ + $('#action-participate').removeClass('ui-state-active'); + $('#action-carte').addClass('ui-state-active'); + $('#edit-actions').hide(); + $('#map-actions').show(); + $('#edit-panel').hide(); + $('#map-panel').show(); + }); + + $("#action-participate").click(function(){ + $('#action-carte').removeClass('ui-state-active'); + $('#action-participate').addClass('ui-state-active'); + $('#map-actions').hide(); + $('#edit-actions').show(); + $('#map-panel').hide(); + $('#edit-panel').show(); + // if the default is initialized the other are not + if (!_frm_editmarker_initialized){ + update_editmarker(); + } + }); +}); -- cgit v1.2.3