Opened 10 years ago

Closed 10 years ago

#11872 closed New Feature (fixed)

Allow chaining the after calling addClass

Reported by: Alfonso Martínez de Lizarrondo Owned by:
Priority: Normal Milestone: CKEditor 4.4.1
Component: General Version:
Keywords: Cc:


The!/api/CKEDITOR.dom.element-method-addClass should include a

return this;

for symmetry with removeClass and to follow the same pattern that other frameworks like jQuery that allows chaining calls to the element.

Change History (2)

comment:1 Changed 10 years ago by Jakub Ś

Status: newconfirmed

There is nothing more to say :). I fully agree with this one.

comment:2 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.1
Resolution: fixed
Status: confirmedclosed

Fixed on master with git:06bdff1b4.

However, I'm not a huge fan of chaining. It's a nice pattern and in some cases it helps a lot, but not much in ours. It reduces readability a bit, it reserves return values so one must be very careful when making new methods chainable, it requires additional code (return statements), etc. And there's no much profit from it. So, I don't think we'll start making most of our methods chainable.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy