metamaps--metamaps/app/views/maps/create.js.erb

34 lines
883 B
Text
Raw Normal View History

/*
* @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();
2013-01-06 23:40:48 +00:00
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>");
2013-01-06 23:40:48 +00:00
}
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>");
2013-01-06 23:40:48 +00:00
}
function closeIt() {
form.fadeOut('fast', function(){
form.html(tempForm);
});
}