33 lines
883 B
Text
33 lines
883 B
Text
/*
|
|
* @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 %>
|
|
|
|
|
|
var tempForm = form.html();
|
|
if (mapid == null) {
|
|
form.html("Success! Do you want to <br> <a href='/maps/" + '<%= @map.id %>' + "'>Go to your new map?</a><br>or<br><a href='javascript:closeIt(); event.preventDefault();'>Stay on this page?</a>");
|
|
}
|
|
else if (mapid != null) {
|
|
form.html("Success! Do you want to <br> <a href='/maps/" + '<%= @map.id %>' + "'>Go to your new map?</a><br>or<br><a href='javascript:closeIt(); event.preventDefault();'>Stay on this map?</a>");
|
|
}
|
|
|
|
function closeIt() {
|
|
form.fadeOut('fast', function(){
|
|
form.html(tempForm);
|
|
});
|
|
}
|