<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22942</bug_id>
          
          <creation_ts>2013-08-13 20:45:45 +0000</creation_ts>
          <short_desc>We should fire onopen and onclose when &lt;details&gt; is opened and closed.</short_desc>
          <delta_ts>2013-11-06 19:13:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#attr-details-open</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>d</cc>
    
    <cc>ian</cc>
    
    <cc>mathias</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92007</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-08-13 20:45:45 +0000</bug_when>
    <thetext>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 &lt;details&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92998</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2013-09-04 18:36:51 +0000</bug_when>
    <thetext>I don&apos;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&apos;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: {
    &apos;toggle details.my-details&apos;: function (ev) {
      this.$(&apos;.related-thing-to-toggle&apos;).toggleClass(&apos;active&apos;, ev.target.open);
    }
  }
});</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92999</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-09-04 19:08:26 +0000</bug_when>
    <thetext>So a single event, but fire it after the state has changed. That makes sense.

ontoggle=&quot;&quot; is ok, but not ideal. Anyone got a better colour for this shed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95876</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-06 18:11:43 +0000</bug_when>
    <thetext>I went with &apos;toggle&apos; as suggested.

Checked in as WHATWG revision r8251.
Check-in comment: &lt;details ontoggle=&apos;&apos;&gt; for when you open or close a &lt;dialog&gt;.
http://html5.org/tools/web-apps-tracker?from=8250&amp;to=8251</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95878</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-06 19:13:27 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8252.
Check-in comment: ack for last checkin
http://html5.org/tools/web-apps-tracker?from=8251&amp;to=8252</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>