/* * @file * Javascript run on creation of a new map */ $('#map_name').val(''); $('#map_desc').val(''); $('#map_permission').val('commons'); <% if @forked %> $('#map_topicsToMap').val('0'); $('#map_synapsesToMap').val('0'); var form = $('#fork_map'); <% else %> var form = $('#new_map'); <% end %> form.find('.mapPermIcon').removeClass('selected'); form.find('.mapCommonsIcon').addClass('selected'); var tempForm = form.html(); if (mapid == null) { form.html("Success! Do you want to
' + "'>Go to your new map?
or
Stay on this page?"); } else if (mapid != null) { form.html("Success! Do you want to
' + "'>Go to your new map?
or
Stay on this map?"); } $('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px' ); function closeIt() { $('#lightbox_overlay').hide(); form.html(tempForm); // bind permission changer events form.find('.permIcon').click(function() { $(this).siblings('#map_permission').val( $(this).attr('data-permission') ); $(this).siblings('.permIcon').find('.mapPermIcon').removeClass('selected'); $(this).find('.mapPermIcon').addClass('selected'); }); }