Sha256: 4030e2f42742c0c88e855d6f341b8dee4ab5e722782c2969aff74153a382dfb6
Contents?: true
Size: 840 Bytes
Versions: 64
Compression:
Stored size: 840 Bytes
Contents
pageflow.StorylineTransitiveChildPages = function(storyline, storylines, pages) { var isTranstiveChildStoryline; this.contain = function(page) { if (!isTranstiveChildStoryline) { search(); } return !!isTranstiveChildStoryline[page.chapter.storyline.id]; }; function search() { isTranstiveChildStoryline = storylines.reduce(function(memo, other) { var current = other; while (current) { if (current === storyline || memo[current.id]) { memo[other.id] = true; return memo; } current = parentStoryline(current); } return memo; }, {}); } function parentStoryline(storyline) { var parentPage = pages.getByPermaId(storyline.parentPagePermaId()); return parentPage && parentPage.chapter && parentPage.chapter.storyline; } };
Version data entries
64 entries across 64 versions & 1 rubygems