timdown/rangy — pull request #217 by tobiasschweizer (2014-06-25 09:43:15+00:00)
Title: handling of attributes

The code I inserted adds elementAttributes when the corresponding cssClassApplier is called (apply class) on a selection which already has a span and a class. So far, only the new class was added without considering the attribute.

Vice versa, the attribute has also to be removed when the corresponding cssClassApplier is called again (remove class).

I am defining attributes like this:

var conf = {
normalize: false,
applyToEditableOnly: true,
elementAttributes: {
myattr: -1
}
};

var link = rangy.createCssClassApplier('myclass', conf);