Sha256: 2506e7d349aa8e9923042781e9fba6c1fdc5b2ead21e9cd978cbbca2c653d5fb

Contents?: true

Size: 1001 Bytes

Versions: 2

Compression:

Stored size: 1001 Bytes

Contents

window.SC ||={}

class SC.Project extends Backbone.Model

  initialize: ->
    @isRendered = false
    @photos = new SC.PhotosCollection(this.get 'photos')
    @currentPhoto = @photos.first()

  switchToNextPhoto: ->
    @currentPhoto.hide('slideLeft')
    @currentPhoto = this.nextPhoto()
    @currentPhoto.show('slideRight')

  nextPhoto: ->
    @photos.successor_of(@currentPhoto)

  switchToPreviousPhoto: ->
    @currentPhoto.hide('slideRight')
    @currentPhoto = this.previousPhoto()
    @currentPhoto.show('slideLeft')

  previousPhoto: ->
    @photos.predecessor_of(@currentPhoto)

  activate: (effect) ->
    @currentPhoto.show(effect)
    this.trigger 'activated'

  deactivate: (effect) ->
    @currentPhoto.hide(effect)

  showingFirstPhoto: ->
    @currentPhoto == @photos.first()

  showingLastPhoto: ->
    @currentPhoto == @photos.last()

  forwardPhotos: ->
    @currentPhoto = @photos.last()

  rewindPhotos: ->
    @currentPhoto.hide('instant')
    @currentPhoto = @photos.first()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
partystreusel-0.0.2 vendor/assets/javascripts/carousel/models/project.js.coffee
partystreusel-0.0.1 vendor/assets/javascripts/carousel/models/project.js.coffee