From 8e7beabaf06f78d2fa26243990be299385ec0e14 Mon Sep 17 00:00:00 2001 From: ampli Date: Wed, 29 Jun 2011 03:24:33 +0300 Subject: [PATCH] Fix #12179. In WebKit browsers, when a schema is saved, existing column field types are reset to "Text". This is not a bug in WebKit, and will happen in any browser that implements Option() as documented. Option() is not supposed to have an immediate action if only the default selection is updated on a newly added select object. See: http://download.oracle.com/docs/cd/E19957-01/816-6408-10/option.htm . Repeat-By: 1. New Content->basic->Datatable 2. data 3. Edit Schema 4. col1, Number, Add Column 5. col2, E-mail, Add Column 6. col3, URL, Add Column 7. Edit Schema (note that the field types got reset to "Text") 8 Save (now the field types incorrectly got overwritten in the DataTable) Fixed by adding 4th arguments to actually make the new selection to be equal to the default one. --- www/extras/yui-webgui/build/form/datatable.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/extras/yui-webgui/build/form/datatable.js b/www/extras/yui-webgui/build/form/datatable.js index 651c5f1ce..a2573b682 100644 --- a/www/extras/yui-webgui/build/form/datatable.js +++ b/www/extras/yui-webgui/build/form/datatable.js @@ -459,10 +459,12 @@ WebGUI.Form.DataTable format.name = "format_" + i; for ( var x = 0; x < availableFormats.length; x++ ) { + var selected = cols[i].formatter == availableFormats[x].value; var opt = new Option( availableFormats[x].label, availableFormats[x].value, - cols[i].formatter == availableFormats[x].value + selected, + selected ); format.appendChild( opt ); }