There was a clash of 'type' attribute in widget's spec. Usually 'type' is used for telling a builder which field and widget to build. Text widget used this attribute also for definion of html input type. It was problematic for some special widgets, which defined own field and used text_widget, like service_type or dnszone_name. In those and possibly other cases it used widget type for specifying input type which lead to execution error in Internet Explorer. Firefox and Chrome took it.

This patch is changing text_widget's 'type' to 'input_type' which removes the collision and hence fixes the problem.


https://fedorahosted.org/freeipa/ticket/2806
and half of: https://fedorahosted.org/freeipa/ticket/2834
--
Petr Vobornik

From f2ed7294fb558895ea9d84d30b010f56069d88a8 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Thu, 12 Jul 2012 14:43:47 +0200
Subject: [PATCH] Differentiation of widget type and text_widget input type

There was a clash of 'type' attribute in widget's spec. Usually 'type' is used for telling a builder which field and widget to build. Text widget used this attribute also for definion of html input type. It was problematic for some special widgets, which defined own field and used text_widget, like service_type or dnszone_name. In those and possibly other cases it used widget type for specifying input type which lead to execution error in Internet Explorer. Firefox and Chrome took it.

This patch is changing text_widget's 'type' to 'input_type' which removes the collision and hence fixes the problem.

https://fedorahosted.org/freeipa/ticket/2806
and half of: https://fedorahosted.org/freeipa/ticket/2834
---
 install/ui/widget.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/ui/widget.js b/install/ui/widget.js
index 64547da7d439cb622c03d6f73afb310be83a6338..6864d88f5f08a4064b9b5b1cded527d5e99504ff 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -231,7 +231,7 @@ IPA.text_widget = function(spec) {
     var that = IPA.input_widget(spec);
 
     that.size = spec.size || 30;
-    that.type = spec.type || 'text';
+    that.input_type = spec.input_type || 'text';
 
     that.select_range = function(start, end){
         IPA.select_range(that.input, start, end);
@@ -249,7 +249,7 @@ IPA.text_widget = function(spec) {
         }).appendTo(container);
 
         that.input = $('<input/>', {
-            type: that.type,
+            type: that.input_type,
             name: that.name,
             disabled: that.disabled,
             size: that.size,
@@ -330,7 +330,7 @@ IPA.text_widget = function(spec) {
 IPA.password_widget = function(spec) {
 
     spec = spec || {};
-    spec.type = 'password';
+    spec.input_type = 'password';
 
     var that = IPA.text_widget(spec);
     return that;
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to