Sha256: 97b709fed3fdb0390561a42d1593f4e3ae6efe358ef4c1a46b3592cebe6cbe71

Contents?: true

Size: 1.31 KB

Versions: 71

Compression:

Stored size: 1.31 KB

Contents

define ["frank"], (frank)->

  ErsatzModel = Backbone.Model.extend
    default: 
      highlightFrames = []

    initialize: ->
      @refreshBaseScreenshot()

    highlightSomeFramesForABit: (frames)->
      @set('highlightFrames',frames)
      @temporaryHighlightTimeout = window.setTimeout( =>
        @set('highlightFrames',[])
        @temporaryHighlightTimeout = undefined
      , 1500 )

    resetViews: (views,deviceFamily,orientation)->
      @set('allViews',views)
      @set('deviceFamily',deviceFamily)
      @set('orientation',orientation)
      @set('highlightFrames',[])
      @configureAllViews(views)

    refreshBaseScreenshot: ->
      @set('baseScreenshotUrl',frank.baseScreenshotUrl())

    toggleAsploded: ->
      isAsploded = !(@get('isAsploded'))
      @set('isAsploded',isAsploded)
      if isAsploded
        @updateAsplodedViews()

      isAsploded

    updateAsplodedViews: ()->
      frank.requestSnapshotRefresh().done =>
        @trigger('snapshots-refreshed',@)
    
    configureAllViews: (allViews)->
      allViews.on 'change:active', (subject,isActive)=>
        window.clearTimeout(@temporaryHighlightTimeout) if @temporaryHighlightTimeout?

        if isActive && !@get('isAsploded')
          @set('highlightFrames',[subject.get('accessibilityFrame')])
        else
          @set('highlightFrames',[])

Version data entries

71 entries across 54 versions & 5 rubygems

Version Path
sc-frank-ios-1.2.3 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-cucumber-1.2.5 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-cucumber-1.2.4.pre1 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.3.0.pre.2 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.bba52d7.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.e1e3ccb.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.1a856ca.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.3.0.pre.1 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.2.4 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.2.3.pre.2 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.2.3.pre.1 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-pivotal-1.2.3 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.b7791c5.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
frank-cucumber-1.2.3 frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.3256dc1.debug frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_model.coffee
sc-frank-cucumber-1.2.1.9c95c03.debug frank-skeleton/frank_static_resources.bundle/js/ersatz_model.coffee