Remove unwanted trimming in text fields

UI trims whitespace at the beginning or at the end when user data
are being saved. This confuses is_dirty function which incorrectly
recognizes given field as modified.

This patch fixes this issue for both general text fields and
ACI filter field.

https://fedorahosted.org/freeipa/ticket/1096
This commit is contained in:
Martin Kosek
2011-03-29 13:24:06 +02:00
committed by Endi Sukma Dewata
parent 5700920627
commit d9c1761234
2 changed files with 5 additions and 5 deletions

View File

@@ -422,7 +422,7 @@ IPA.target_section = function(spec) {
that.filter_text.save = function(){ that.filter_text.save = function(){
var input = $('input[name="'+that.filter_text.name+'"]', var input = $('input[name="'+that.filter_text.name+'"]',
that.filter_text.container); that.filter_text.container);
var value = $.trim(input.val()); var value = input.val();
return value === '' ? [] : [value]; return value === '' ? [] : [value];
}; };

View File

@@ -358,7 +358,7 @@ IPA.text_widget = function(spec) {
} else { } else {
var input = $('input[name="'+that.name+'"]', that.container); var input = $('input[name="'+that.name+'"]', that.container);
var value = $.trim(input.val()); var value = input.val();
return value === '' ? [] : [value]; return value === '' ? [] : [value];
} }
}; };
@@ -477,7 +477,7 @@ IPA.multivalued_text_widget = function(spec) {
if (that.read_only || !that.writable) { if (that.read_only || !that.writable) {
$('label[name="'+that.name+'"]', that.container).each(function() { $('label[name="'+that.name+'"]', that.container).each(function() {
var input = $(this); var input = $(this);
var value = $.trim(input.html()); var value = input.html();
values.push(value); values.push(value);
}); });
@@ -486,7 +486,7 @@ IPA.multivalued_text_widget = function(spec) {
var input = $(this); var input = $(this);
if (input.is('.strikethrough')) return; if (input.is('.strikethrough')) return;
var value = $.trim(input.val()); var value = input.val();
values.push(value); values.push(value);
}); });
} }
@@ -1482,4 +1482,4 @@ IPA.entity_select_widget = function(spec) {
}; };
return that; return that;
}; };