JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.1
[ckeditor.git] / _source / plugins / flash / dialogs / flash.js
index 5634229..666d3c8 100644 (file)
@@ -265,12 +265,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                paramMap[ paramList.getItem( i ).getAttribute( 'name' ) ] = paramList.getItem( i );\r
                                }\r
 \r
-                               // Apply or remove flash parameters.\r
-                               var extraStyles = {};\r
-                               this.commitContent( objectNode, embedNode, paramMap, extraStyles );\r
+                               // A subset of the specified attributes/styles\r
+                               // should also be applied on the fake element to\r
+                               // have better visual effect. (#5240)\r
+                               var extraStyles = {}, extraAttributes = {};\r
+                               this.commitContent( objectNode, embedNode, paramMap, extraStyles, extraAttributes );\r
 \r
                                // Refresh the fake image.\r
                                var newFakeImage = editor.createFakeElement( objectNode || embedNode, 'cke_flash', 'flash', true );\r
+                               newFakeImage.setAttributes( extraAttributes );\r
                                newFakeImage.setStyles( extraStyles );\r
                                if ( this.fakeImage )\r
                                {\r
@@ -572,7 +575,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                [ editor.lang.flash.alignTop , 'top']\r
                                                                        ],\r
                                                                        setup : loadValue,\r
-                                                                       commit : commitValue\r
+                                                                       commit : function( objectNode, embedNode, paramMap, extraStyles, extraAttributes )\r
+                                                                       {\r
+                                                                               var value = this.getValue();\r
+                                                                               commitValue.apply( this, arguments );\r
+                                                                               value && ( extraAttributes.align = value );\r
+                                                                       }\r
                                                                },\r
                                                                {\r
                                                                        type : 'html',\r