JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / stylescombo / plugin.js
index fb44d5c..d2f8eb3 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -106,12 +106,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                                var elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() );\r
 \r
-                                               if ( style.type == CKEDITOR.STYLE_INLINE && style.checkActive( elementPath ) )\r
-                                                       style.remove( editor.document );\r
-                                               else if ( style.type == CKEDITOR.STYLE_OBJECT && style.checkActive( elementPath ) )\r
-                                                       style.remove( editor.document );\r
-                                               else\r
-                                                       style.apply( editor.document );\r
+                                               style[ style.checkActive( elementPath ) ? 'remove' : 'apply' ]( editor.document );\r
 \r
                                                editor.fire( 'saveSnapshot' );\r
                                        },\r