Opened 9 years ago
Closed 8 years ago
#14258 closed Bug (expired)
Style Definitions with Variable Values Is Not Replacing ._AC Object Correctly
Reported by: | Phuoc Huynh | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.5.4 |
Keywords: | Cc: |
Description
Hello there,
I noticed I bug where CKEDITOR.style is defined in style.js, in the case of variable values, styleDefinition._AC is not being replaced. I encountered this issue when I try to remove a style with variable values, when checkElementMatch is called, we see a discrepancy between styleDefinition.attributes and styleDefinition._AC. For example, styleDefinition.attributes will have the replaced value, myColor: 'white', but styleDefinition._AC will have the non-replaced placeholder, myColor: '#(color)'.
Relevant code block:
if ( variablesValues ) { styleDefinition = CKEDITOR.tools.clone( styleDefinition ); replaceVariables( styleDefinition.attributes, variablesValues ); replaceVariables( styleDefinition.styles, variablesValues ); }
Proposed code change:
if ( variablesValues ) { styleDefinition = CKEDITOR.tools.clone( styleDefinition ); replaceVariables( styleDefinition.attributes, variablesValues ); replaceVariables( styleDefinition.styles, variablesValues ); if ( styleDefiniton._AC ) { replaceVariables( styleDefinition._AC, variablesValues ); } }
Thank you!
Change History (2)
comment:1 Changed 9 years ago by
Status: | new → pending |
---|
comment:2 Changed 8 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
Could you provide exact steps to reproduce this problem?
I'm not sure if i understand correctly but are you trying to add dynamic values there? If that is the case then such feature is not supported. The dropdown needs to know the color before rendering. Please see: http://docs.ckeditor.com/#!/guide/dev_howtos_styles (it doesn't mention any variables)
We have
'#(color)'
in few places but in colorbutton plugin only so I don't think you were referring to CKEditor code for styles.