Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.6.3
[ckeditor.git]
/
_source
/
plugins
/
styles
/
plugin.js
diff --git
a/_source/plugins/styles/plugin.js
b/_source/plugins/styles/plugin.js
index
1d822d1
..
2c16b7e
100644
(file)
--- a/
_source/plugins/styles/plugin.js
+++ b/
_source/plugins/styles/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\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
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-1132,8
+1132,9
@@
CKEDITOR.STYLE_OBJECT = 3;
function removeFromElement( style, element )
\r
{
\r
var def = style._.definition,
\r
function removeFromElement( style, element )
\r
{
\r
var def = style._.definition,
\r
- attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ),
\r
+ attributes = def.attributes,
\r
styles = def.styles,
\r
styles = def.styles,
\r
+ overrides = getOverrides( style )[ element.getName() ],
\r
// If the style is only about the element itself, we have to remove the element.
\r
removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );
\r
\r
// If the style is only about the element itself, we have to remove the element.
\r
removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );
\r
\r
@@
-1159,6
+1160,9
@@
CKEDITOR.STYLE_OBJECT = 3;
element.removeStyle( styleName );
\r
}
\r
\r
element.removeStyle( styleName );
\r
}
\r
\r
+ // Remove overrides, but don't remove the element if it's a block element
\r
+ removeOverrides( element, overrides, blockElements[ element.getName() ] ) ;
\r
+
\r
if ( removeEmpty )
\r
{
\r
!CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ?
\r
if ( removeEmpty )
\r
{
\r
!CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ?
\r
@@
-1200,8
+1204,9
@@
CKEDITOR.STYLE_OBJECT = 3;
* Note: Remove the element if no attributes remain.
\r
* @param {Object} element
\r
* @param {Object} overrides
\r
* Note: Remove the element if no attributes remain.
\r
* @param {Object} element
\r
* @param {Object} overrides
\r
+ * @param {Boolean} Don't remove the element
\r
*/
\r
*/
\r
- function removeOverrides( element, overrides )
\r
+ function removeOverrides( element, overrides, dontRemove )
\r
{
\r
var attributes = overrides && overrides.attributes ;
\r
\r
{
\r
var attributes = overrides && overrides.attributes ;
\r
\r
@@
-1229,7
+1234,8
@@
CKEDITOR.STYLE_OBJECT = 3;
}
\r
}
\r
\r
}
\r
}
\r
\r
- removeNoAttribsElement( element );
\r
+ if ( !dontRemove )
\r
+ removeNoAttribsElement( element );
\r
}
\r
\r
// If the element has no more attributes, remove it.
\r
}
\r
\r
// If the element has no more attributes, remove it.
\r