From d9c17612341af82405873dde120b177dbc0abd83 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Tue, 29 Mar 2011 13:24:06 +0200 Subject: 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 --- install/ui/aci.js | 2 +- install/ui/widget.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/ui/aci.js b/install/ui/aci.js index e7e0c563..55d514cf 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -422,7 +422,7 @@ IPA.target_section = function(spec) { that.filter_text.save = function(){ var input = $('input[name="'+that.filter_text.name+'"]', that.filter_text.container); - var value = $.trim(input.val()); + var value = input.val(); return value === '' ? [] : [value]; }; diff --git a/install/ui/widget.js b/install/ui/widget.js index 8680086e..ba02a844 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -358,7 +358,7 @@ IPA.text_widget = function(spec) { } else { var input = $('input[name="'+that.name+'"]', that.container); - var value = $.trim(input.val()); + var value = input.val(); return value === '' ? [] : [value]; } }; @@ -477,7 +477,7 @@ IPA.multivalued_text_widget = function(spec) { if (that.read_only || !that.writable) { $('label[name="'+that.name+'"]', that.container).each(function() { var input = $(this); - var value = $.trim(input.html()); + var value = input.html(); values.push(value); }); @@ -486,7 +486,7 @@ IPA.multivalued_text_widget = function(spec) { var input = $(this); if (input.is('.strikethrough')) return; - var value = $.trim(input.val()); + var value = input.val(); values.push(value); }); } @@ -1482,4 +1482,4 @@ IPA.entity_select_widget = function(spec) { }; return that; -}; \ No newline at end of file +}; -- cgit