JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / dialogui / plugin.js
index 826dc57..963c80c 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -224,7 +224,7 @@ CKEDITOR.plugins.add( 'dialogui' );
 \r
                                initPrivateObject.call( this, elementDefinition );\r
                                var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput',\r
-                                       attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : 'text' },\r
+                                       attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : elementDefinition.type },\r
                                        i;\r
 \r
                                // Set the validator, if any.\r
@@ -855,7 +855,9 @@ CKEDITOR.plugins.add( 'dialogui' );
                                var innerHTML = function()\r
                                {\r
                                        var html = [];\r
-                                       legendLabel && html.push( '<legend>' + legendLabel + '</legend>' );\r
+                                       legendLabel && html.push( '<legend' +\r
+                                               ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +\r
+                                               '>' + legendLabel + '</legend>' );\r
                                        for ( var i = 0; i < childHtmlList.length; i++ )\r
                                                html.push( childHtmlList[ i ] );\r
                                        return html.join( '' );\r
@@ -969,7 +971,13 @@ CKEDITOR.plugins.add( 'dialogui' );
                                                /** @ignore */\r
                                                onClick : function( dialog, func )\r
                                                {\r
-                                                       this.on( 'click', func );\r
+                                                       this.on( 'click', function()\r
+                                                               {\r
+                                                                       // Some browsers (Chrome, IE8, IE7 compat mode) don't move\r
+                                                                       // focus to clicked button. Force this.\r
+                                                                       this.getElement().focus();\r
+                                                                       func.apply( this, arguments );\r
+                                                               });\r
                                                }\r
                                        }, true ),\r
 \r