Sha256: 5b311e1041acaf0b3e38a0e971985002d1bb09931a1a7bcd3e9e2811f3ca7d79

Contents?: true

Size: 1.55 KB

Versions: 58

Compression:

Stored size: 1.55 KB

Contents

define ['experiment_bar_model','dropdown_control'], (ExperimentBarModel,DropdownControl)->

  ExperimentBarView = Backbone.View.extend
    el: $("#selector-test")

    initialize: ->
      @actionDropdownView = new DropdownControl.DropdownView()
      @actionDropdownView.setElement(@$('.action-buttons'))
      @actionDropdownView.collection.reset([
        {name: 'highlight', text:'Highlight'},
        {name: 'touch', text:'Touch In App'},
        {name: 'flash', text:'Flash In App'}
      ])
      @actionDropdownView.collection.at(0).select()
      @actionDropdownView.collection.on 'option-clicked', (option)=> @actionClicked(option.get('name'))

      @engineDropdownView = new DropdownControl.DropdownView()
      @engineDropdownView.setElement(@$('.selector-engine'))
      @engineDropdownView.collection.reset([
        {name: 'shelley_compat', text:'Shelley'},
        {name: 'uiquery', text:'UIQuery'},
        {name: 'calabash_uispec', text:'Calabash'}
      ])
      @engineDropdownView.collection.at(0).select()
      @engineDropdownView.collection.on 'option-clicked', (option)=> 
        @model.set( 'selectorEngine', (option.get('name')) )

      @$selectorInput = @$('input#query')
     
      
      @model = new ExperimentBarModel()
      @model.on 'change', _.bind(@update,@)
      @update()

    update: ->
      @$selectorInput.val( @model.get('selector') )

    actionClicked: (actionName)->
      @updateModelFromSelectorInput() 
      @model.actionClicked(actionName)


    updateModelFromSelectorInput: ->
      @model.set( 'selector', @$selectorInput.val() )

Version data entries

58 entries across 41 versions & 5 rubygems

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