JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / plugins / styles / plugin.js
index 2c16b7e..26519c6 100644 (file)
@@ -218,9 +218,8 @@ CKEDITOR.STYLE_OBJECT = 3;
                        return true;\r
                },\r
 \r
-               // Checks if an element, or any of its attributes, is removable by the\r
-               // current style definition.\r
-               checkElementRemovable : function( element, fullMatch )\r
+               // Check if the element matches the current style definition.\r
+               checkElementMatch : function( element, fullMatch )\r
                {\r
                        var def = this._.definition;\r
 \r
@@ -266,10 +265,23 @@ CKEDITOR.STYLE_OBJECT = 3;
                                        return true;\r
                        }\r
 \r
-                       // Check if the element can be somehow overriden.\r
+                       return false;\r
+               },\r
+\r
+               // Checks if an element, or any of its attributes, is removable by the\r
+               // current style definition.\r
+               checkElementRemovable : function( element, fullMatch )\r
+               {\r
+                       // Check element matches the style itself.\r
+                       if ( this.checkElementMatch( element, fullMatch ) )\r
+                               return true;\r
+\r
+                       // Check if the element matches the style overrides.\r
                        var override = getOverrides( this )[ element.getName() ] ;\r
                        if ( override )\r
                        {\r
+                               var attribs, attName;\r
+\r
                                // If no attributes have been defined, remove the element.\r
                                if ( !( attribs = override.attributes ) )\r
                                        return true;\r