($el, parent)
| 81 | |
| 82 | // Section constructor |
| 83 | function Section($el, parent) { |
| 84 | |
| 85 | if(!parent.options.clickQuery) $el.wrapInner('<a href="#"/>'); |
| 86 | |
| 87 | $.extend(this, { |
| 88 | isOpen : false, |
| 89 | $summary : $el.attr("data-collapse-summary",""), |
| 90 | $details : $el.next(), |
| 91 | options: parent.options, |
| 92 | parent: parent |
| 93 | }); |
| 94 | parent.sections.push(this); |
| 95 | |
| 96 | // Check current state of section |
| 97 | var state = parent.states[this._index()]; |
| 98 | |
| 99 | if(state === 0) { |
| 100 | this.close(true); |
| 101 | } |
| 102 | else if(this.$summary.is(".open") || state === 1) { |
| 103 | this.open(true); |
| 104 | } else { |
| 105 | this.close(true); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | Section.prototype = { |
| 110 | toggle : function() { |
nothing calls this directly
no outgoing calls
no test coverage detected