You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a question regarding the options for createCssClassApplier.
Setting an attribute via options.elementAttributes works well for elements which are newly created.
But when I want to add a class to an existing span which does not have an options.elementAttributes the CSS class is applied correctly but without considering the options.elementsAttributes.
Example:
var conf = {
normalize: true,
applyToEditableOnly: true
};
bold = rangy.createCssClassApplier('bold, conf);
var link_conf = {
normalize: true,
applyToEditableOnly: true,
elementAttributes: {
'data-resid': -1
}
};
// create instance for linking first
link = rangy.createCssClassApplier('_link', link_conf);
If I a make selection in my div (contenteditabe="true") and execute bold.toggleSelection() and then link.toggleSelection() I would expect rangy to also add resid=-1 as an attribute to the span.
Are my assumptions wrong? What effect does options.normalize have?
Thanks and regards
Tobi
The text was updated successfully, but these errors were encountered:
Hi Tim,
a question regarding the options for createCssClassApplier.
Setting an attribute via options.elementAttributes works well for elements which are newly created.
But when I want to add a class to an existing span which does not have an options.elementAttributes the CSS class is applied correctly but without considering the options.elementsAttributes.
Example:
If I a make selection in my div (contenteditabe="true") and execute bold.toggleSelection() and then link.toggleSelection() I would expect rangy to also add resid=-1 as an attribute to the span.
Are my assumptions wrong? What effect does options.normalize have?
Thanks and regards
Tobi
The text was updated successfully, but these errors were encountered: