Sha256: 002f24c900b44e557eb121ea156791fba73f458fef070fb3ab15d06f1043909e

Contents?: true

Size: 438 Bytes

Versions: 4

Compression:

Stored size: 438 Bytes

Contents

Volontariat.ToggleTextComponent = Ember.Component.extend
  length: 140
  collapsed: 'more'
  
  currentText: (-> if @get('collapsed') == 'more' then @get('text').truncate(@get('length')) else @get('text')).property('text', 'collapsed', 'length')
  tooLong: (-> @get('text').length > @get('length')).property('text', 'length')
  
  actions:
    
    toggle: ->
      @set 'collapsed', if @get('collapsed') == 'more' then 'less' else 'more'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
voluntary-ember_js-0.1.0 app/assets/javascripts/voluntary/ember_js/components/toggle_text_component.js.coffee
voluntary-ember_js-0.0.4 app/assets/javascripts/voluntary/ember_js/components/toggle_text_component.js.coffee
voluntary-ember_js-0.0.3 app/assets/javascripts/voluntary/ember_js/components/toggle_text_component.js.coffee
voluntary-ember_js-0.0.2 app/assets/javascripts/voluntary/ember_js/components/toggle_text_component.js.coffee