Sha256: a543915c801297a299071cec24841588be041b57def9d1cbaca6f6982292d94e
Contents?: true
Size: 1.74 KB
Versions: 64
Compression:
Stored size: 1.74 KB
Contents
pageflow.PageNavigationListAnimation = pageflow.Object.extend({ initialize: function(entryData) { this.entry = entryData; }, update: function(currentPagePermaId) { var currentPagePosition = this.entry.getPagePosition(currentPagePermaId); var currentStorylineId = this.entry.getStorylineIdByPagePermaId(currentPagePermaId); var currentStorylineLevel = this.entry.getStorylineLevel(currentStorylineId); this.enabled = this.lastStorylineId && this.lastStorylineId !== currentStorylineId; this.movingUp = (this.lastStorylineLevel > currentStorylineLevel); this.movingDown = (this.lastStorylineLevel < currentStorylineLevel); this.movingForwards = (this.lastStorylineLevel === currentStorylineLevel && this.lastPagePosition < currentPagePosition); this.movingBackwards = (this.lastStorylineLevel === currentStorylineLevel && this.lastPagePosition > currentPagePosition); this.lastPagePosition = currentPagePosition; this.lastStorylineId = currentStorylineId; this.lastStorylineLevel = currentStorylineLevel; }, start: function(element, visible) { if (this.enabled) { element.toggleClass('moving_up', this.movingUp); element.toggleClass('moving_down', this.movingDown); element.toggleClass('moving_forwards', this.movingForwards); element.toggleClass('moving_backwards', this.movingBackwards); element.toggleClass('animate_out', !visible); } }, finish: function(element, visible) { if (this.enabled) { element.toggleClass('animate_in', !!visible); } } }); pageflow.PageNavigationListAnimation.create = function() { return new pageflow.PageNavigationListAnimation(pageflow.entryData); };
Version data entries
64 entries across 64 versions & 1 rubygems