File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 105105 }
106106 } ;
107107
108- // `contents` must include an element with the class 'content' and can
109- // optionally include a number of Ratchet bar elements (see `barSelectors`)
108+ // `contents` can either be a string of HTML or a DOM object.
109+ // Either way, `contents` must include:
110+ // * bar elements (optional -- see `barSelectors`)
111+ // * a single content element
112+ // All as children of a single parent.
113+ //
114+ // For example:
115+ // <div>
116+ // <div class="bar-tab"></div>
117+ // <div class="bar-nav"></div>
118+ // <div class="contents"></div>
119+ // </div>
110120 var TRANSITION = function ( contents , transition , complete ) {
121+
122+ if ( typeof ( contents ) === 'string' || contents instanceof String ) {
123+ var div = document . createElement ( 'div' ) ;
124+ div . innerHTML = contents ;
125+ contents = div . childNodes [ 0 ] ;
126+ }
127+
111128 if ( transition ) {
112129 updateBars ( contents ) ;
113130
You can’t perform that action at this time.
0 commit comments