Sha256: 942bc016632b05c50982398390095526e49b14e96c85342012c1e68975e9b126

Contents?: true

Size: 703 Bytes

Versions: 7

Compression:

Stored size: 703 Bytes

Contents

#= require ./base

MomentPicker = Tao.Form.MomentPicker

class MomentPicker.MinuteSegment extends MomentPicker.SegmentBase

  @tag 'tao-moment-picker-minute-segment'

  segmentName: 'minute'

  _bind: ->
    @on 'click', '.minute', (e) =>
      $minute = $ e.currentTarget
      momentData = _.clone @momentData
      momentData.minute = $minute.data 'minute'
      @trigger 'tao:dataSelect', [momentData]

  setMomentData: (momentData) ->
    super
    @_render()
    @momentData

  _render: ->
    @jq.find('.minute.selected').removeClass 'selected'
    unless _.isNil @value()
      @jq.find(".minute[data-minute='#{@value()}']").addClass 'selected'

TaoComponent.register MomentPicker.MinuteSegment

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tao_form-0.1.9 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.8 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.7 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.6 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.5 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.4 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee
tao_form-0.1.3 lib/assets/javascripts/tao/form/shared/fields/moment_picker/segments/minute_segment.coffee