Browse Source

Support HTML string as argument to TRANSITION fn

pull/684/head
Nate Delage 10 years ago
parent
commit
3ac0b8c8f7
  1. 21
      js/transitions.js

21
js/transitions.js

@ -105,9 +105,26 @@
}
};
// `contents` must include an element with the class 'content' and can
// optionally include a number of Ratchet bar elements (see `barSelectors`)
// `contents` can either be a string of HTML or a DOM object.
// Either way, `contents` must include:
// * bar elements (optional -- see `barSelectors`)
// * a single content element
// All as children of a single parent.
//
// For example:
// <div>
// <div class="bar-tab"></div>
// <div class="bar-nav"></div>
// <div class="contents"></div>
// </div>
var TRANSITION = function (contents, transition, complete) {
if(typeof(contents) === 'string' || contents instanceof String) {
var div = document.createElement('div');
div.innerHTML = contents;
contents = div.childNodes[0];
}
if (transition) {
updateBars(contents);

Loading…
Cancel
Save