This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/ Multipage: http://www.whatwg.org/C#attr-details-open Complete: http://www.whatwg.org/c#attr-details-open Referrer: http://xn--74h.damowmow.com/ Comment: We should fire onopen and onclose when <details> is opened and closed. Posted from: 2620:0:1000:167c:55e0:acbd:8909:3cd8 by ian@hixie.ch User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1588.0 Safari/537.36
I don't have a strong opinion on this, but after consulting with a coworker he prefers one event instead of two. The rationale being that it's easier to bind to a single event with existing client-side frameworks (e.g. Backbone), and then use the boolean value it would give you to e.g. toggle classes: Backbone.View.extend({ events: { 'toggle details.my-details': function (ev) { this.$('.related-thing-to-toggle').toggleClass('active', ev.target.open); } } });
So a single event, but fire it after the state has changed. That makes sense. ontoggle="" is ok, but not ideal. Anyone got a better colour for this shed?
I went with 'toggle' as suggested. Checked in as WHATWG revision r8251. Check-in comment: <details ontoggle=''> for when you open or close a <dialog>. http://html5.org/tools/web-apps-tracker?from=8250&to=8251
Checked in as WHATWG revision r8252. Check-in comment: ack for last checkin http://html5.org/tools/web-apps-tracker?from=8251&to=8252