anchor.diff:          console.log(response);
         }
       });
  -
     };
   
  -  <% if @map.privacy_state == PrivacyState::PRIVATE %> 
  -    $('#share_map_modal_btn').hide();
  -  <% end %>
  -
  -  $('#select_public').click(function(){
  +  $(document).on('click', '#select_public', function(){
       processPrivacy('<%= PrivacyState::PUBLIC %>');
       $('#share_map_modal_btn').show();
  +    
  +    $(this).html('Public  <i class="icon-group">');
  +    $(this).attr('id','select_private');
  +    $(this).attr('class','btn btn-danger');
     });
  -  $('#select_private').click(function(){
  +  $(document).on('click', '#select_private', function(){
       processPrivacy('<%= PrivacyState::PRIVATE %>');
       $('#share_map_modal_btn').hide();
  +
  +    $(this).html('Private  <i class="icon-user">');
  +    $(this).attr('id','select_public');
  +    $(this).attr('class','btn btn-inverse');
     });
   
   	</script>
  
positive.code: 
  
    var processPrivacy = function(state){
  
      $.ajax({
        type: 'POST',
        url: '<%= map_privacy_state_path(@map) %>',
  
negative.code:   	<span class="pull-right" >
    		
    		<%= link_to "Share", "#share_map_modal",'data-toggle' => "modal", :class=>'btn', id: 'share_map_modal_btn'%>
    		  
        <% if @map.privacy_state == PrivacyState::PUBLIC %>
          <button type="button" class="btn btn-danger" id="select_private" >Public  <i class="icon-group"></i></button>
        <% else %>
          <button type="button" class="btn btn-inverse" id="select_public"  >Private <i class="icon-user"></i></button>
        <% end %>
  
  
  		</span>	
  		<% end %>
  
  