AJAX call on the issue form resets data entered during the call (#14621).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12166 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
886284b33f
commit
2c97f9ecde
|
@ -1,4 +1,4 @@
|
||||||
$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>');
|
replaceIssueFormWith('<%= escape_javascript(render :partial => 'form') %>');
|
||||||
|
|
||||||
<% if User.current.allowed_to?(:log_time, @issue.project) %>
|
<% if User.current.allowed_to?(:log_time, @issue.project) %>
|
||||||
$('#log_time').show();
|
$('#log_time').show();
|
||||||
|
|
|
@ -444,8 +444,10 @@ function randomKey(size) {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't use Rails' remote select because we need the form data
|
|
||||||
function updateIssueFrom(url) {
|
function updateIssueFrom(url) {
|
||||||
|
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
|
||||||
|
$(this).data('valuebeforeupdate', $(this).val());
|
||||||
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'post',
|
type: 'post',
|
||||||
|
@ -453,6 +455,21 @@ function updateIssueFrom(url) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function replaceIssueFormWith(html){
|
||||||
|
var replacement = $(html);
|
||||||
|
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
|
||||||
|
var object_id = $(this).attr('id');
|
||||||
|
if (object_id && $(this).data('valuebeforeupdate')!=$(this).val()) {
|
||||||
|
replacement.find('#'+object_id).val($(this).val());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#all_attributes').empty();
|
||||||
|
$('#all_attributes').prepend(replacement);
|
||||||
|
if (focus) {
|
||||||
|
$('#'+focus).focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateBulkEditFrom(url) {
|
function updateBulkEditFrom(url) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
|
|
Loading…
Reference in New Issue