Skip to content

Commit

Permalink
re-import fonts as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyBanks committed Aug 14, 2012
1 parent 0479a02 commit d2ad115
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions js/setup.js
Expand Up @@ -55,6 +55,10 @@ addEventListener( "DOMContentLoaded", function() {
set: function( start ) {
_el.setAttribute( "data-popcorn-slideshow", start );

if ( !_el.parentNode ) {
throw new Error("Moving detached element E = ", window.E = _el);
}

var successor = null,
parent = _el.parentNode,
siblings = parent.childNodes,
Expand Down Expand Up @@ -557,7 +561,7 @@ addEventListener( "DOMContentLoaded", function() {
newSlideCount;

tmpContainer.innerHTML = this.result;
slidesRoot = tmpContainer.querySelector( ".deck-container" );
slidesRoot = tmpContainer;

newSlideCount = slidesRoot.querySelectorAll( ".slide" ).length;

Expand All @@ -581,6 +585,10 @@ addEventListener( "DOMContentLoaded", function() {
i = 0,
l = slides.length;

var oldStyle = root.querySelector( "#SVGHelper-fontManager-style" );
SVGHelper.fontManager._reload( oldStyle );
SVGHelper.fontManager.writeFonts();

var deckContainer = document.querySelector( ".deck-container" ),
popcornOptions;

Expand All @@ -590,7 +598,7 @@ addEventListener( "DOMContentLoaded", function() {

// cause it to be moved into the correct document order
popcornOptions.start = popcornOptions.start;

track.addTrackEvent({
type: "slidedrive",
popcornOptions: popcornOptions
Expand Down
4 changes: 2 additions & 2 deletions js/svg-helper.js
Expand Up @@ -486,10 +486,10 @@ document.addEventListener( "DOMContentLoaded", function() {
// This will be run automatically once, either after the DOM has loaded or
// after .writeFonts() is first called. It may be called again safely, but
// that shouldn't be neccessary.
fontManager._reload = function() {
fontManager._reload = function( styleEl ) {
this._reloadCalled = true;

var styleEl = document.getElementById( "SVGHelper-fontManager-style" );
styleEl = styleEl || document.getElementById( "SVGHelper-fontManager-style" );

if ( !styleEl ) {
return this;
Expand Down

0 comments on commit d2ad115

Please sign in to comment.