summaryrefslogtreecommitdiff
path: root/chimere/static/saclay/js/interface.js
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/static/saclay/js/interface.js')
-rw-r--r--chimere/static/saclay/js/interface.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/chimere/static/saclay/js/interface.js b/chimere/static/saclay/js/interface.js
index 2463b60..e978936 100644
--- a/chimere/static/saclay/js/interface.js
+++ b/chimere/static/saclay/js/interface.js
@@ -137,6 +137,17 @@ var routing_panel_open = function(){
var category_panel_open = function(){
action_map();
$("#main-map").chimere('razMap');
+ if($("#switch-menu").is(':visible')){
+ if (!$("#switch-search-result.disabled").length){
+ $("#switch-search-result").addClass('disabled');
+ }
+ if ($("#switch-categories.disabled").length){
+ $("#switch-categories").removeClass('disabled');
+ }
+ if (!$("#switch-categories.selected").length){
+ $("#switch-categories").addClass('selected');
+ }
+ }
$("#id_q").val('');
$('#chimere_itinerary_panel').hide();
$('#search-result').hide();
@@ -167,6 +178,43 @@ var edit_panel_open = function(){
*/
};
+var switch_map = function(){
+ if(!$("#switch-menu").is(':visible')){
+ return;
+ }
+ $("#switch-menu > div").removeClass('selected');
+ $("#switch-map").addClass('selected');
+ $("#panel").fadeOut();
+};
+
+var switch_search_result = function(){
+ if(!$("#switch-menu").is(':visible')){
+ return;
+ }
+ if ($("#switch-search-result.disabled").length){
+ return false;
+ }
+ $('#frm_categories').hide();
+ $('#search-listing').show();
+ $('#search-nav').show();
+ $("#switch-menu > div").removeClass('selected');
+ $("#switch-search-result").addClass('selected');
+ $("#panel").fadeIn();
+};
+
+var switch_categories = function(){
+ if(!$("#switch-menu").is(':visible')){
+ return;
+ }
+ $('#search-listing').hide();
+ $('#search-nav').hide();
+ $('#frm_categories').show();
+ $("#switch-menu > div").removeClass('selected');
+ $("#switch-categories").addClass('selected');
+ $("#panel").fadeIn();
+ $('#frm_categories').show();
+};
+
var init_map_edit;
var map_edit_init = function(){
@@ -255,6 +303,16 @@ $(function(){
$('input[name="transport"]').change(change_routing_transport);
$('input[name="speed"]').change(change_routing_speed);
$('#id_speed').change(change_routing_speed);
+
+ $("#switch-map").click(switch_map);
+ $("#switch-search-result").click(switch_search_result);
+ $("#switch-categories").click(switch_categories);
+ $("#mobile-footer .close-img").click(function(event){
+ $("body").addClass('mobile-footer-hidden');
+ });
+ $("#mobile-footer-open-img").click(function(event){
+ $("body").removeClass('mobile-footer-hidden');
+ });
});
function change_routing_speed(){