summaryrefslogtreecommitdiffstats
path: root/public/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts')
-rw-r--r--public/javascripts/application.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 3a1b9cb79..32202839d 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -444,8 +444,10 @@ function randomKey(size) {
return key;
}
-// Can't use Rails' remote select because we need the form data
function updateIssueFrom(url) {
+ $('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
+ $(this).data('valuebeforeupdate', $(this).val());
+ });
$.ajax({
url: url,
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) {
$.ajax({
url: url,