[Webkit-unassigned] [Bug 148582] classList.toggle(name, force) treats undefined `force` argument as false

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 28 13:46:44 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=148582

--- Comment #3 from Michał Gołębiowski <m.goleb+bugzilla at gmail.com> ---
(In reply to comment #2)
> I will try and address this in the near future.

Great to hear that!

This is very useful when you need to proxy the method. I'm developing an experimental jQuery plugin that replaces its class manipulation code with one utilizing classList and I had to write something like:

if (force !== undefined) {
    this.classList.toggle(clazz, force);
} else {
    this.classList.toggle(clazz);
}

instead of just passing the value. This is the full source:
https://github.com/mzgol/jquery.classList/blob/3a7018254bf0545c54f6ff7d73eb21aadcfb8ec9/src/jquery.class_list.js#L108-L119

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150828/095f9ea6/attachment.html>


More information about the webkit-unassigned mailing list