Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassClassApplier options elementAttributes #213

Closed
tobiasschweizer opened this issue Jun 16, 2014 · 3 comments
Closed

ClassClassApplier options elementAttributes #213

tobiasschweizer opened this issue Jun 16, 2014 · 3 comments

Comments

@tobiasschweizer
Copy link

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:

         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

@timdown
Copy link
Owner

timdown commented Aug 22, 2014

This looks to be at least related to issue #206.

@timdown
Copy link
Owner

timdown commented May 10, 2015

Is this fixed in the most recent version?

@timdown
Copy link
Owner

timdown commented May 10, 2015

I think this is fixed.

@timdown timdown closed this as completed May 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants