Sha256: 70eecf9deaa89b9c49714d2faf03e2a7807a24e97b76b2cba7eb8a025db63c07

Contents?: true

Size: 1.91 KB

Versions: 26

Compression:

Stored size: 1.91 KB

Contents

HSpeechBubble = HControl.extend
  textSelectable: true
  componentName: 'speech_bubble'
  markupElemNames: [
    'bg'
    'subview'
    'value'
    'directionbg'
    'directionupperfg'
    'directionlowerfg'
  ]
  controlDefaults: HControlDefaults.extend
    orientation: 'left'
    colors:
      start: '#ffffff'
      steps: [
        [ 9, '#efefef' ]
        [ 91, '#e0e0e0' ]
      ]
      end:   '#efefef'
      text: '#333'
    autoHeight: false
    autoWidth:  false
  adjustHeight: ->
    if @options.autoHeight or @options.autoWidth
      _size = ELEM.getScrollSize( @markupElemIds.value ) 
    if @options.autoHeight
      _height = _size[1] + 3
      @rect.setHeight( _height )
    if @options.autoWidth
      _width = _size[0] + 25
      @rect.setWidth( _width )
    @drawRect() if @options.autoHeight or @options.autoWidth
  setOrientationClass: (_orientation)->
    if _orientation == 'left'
      ELEM.addClassName( @elemId, 'orientation_left' )
      ELEM.delClassName( @elemId, 'orientation_right' )
    else
      ELEM.addClassName( @elemId, 'orientation_right' )
      ELEM.delClassName( @elemId, 'orientation_left' )
  refreshProperties: ->
    _colors = @options.colors
    [ _bgKey, _bgVal ] = ELEM._linearGradientStyle(_colors)
    @setOrientationClass(@options.orientation)
    @setStyleOfPart( 'directionbg', 'borderColor', "transparent transparent #{_colors.text} transparent" )
    @setStyleOfPart( 'directionupperfg', 'borderColor', "transparent transparent #{_colors.steps[_colors.steps.length-1][1]} transparent" )
    @setStyleOfPart( 'directionlowerfg', 'borderColor', "transparent transparent #{_colors.end} transparent" )
    @setStyleOfPart( 'bg', _bgKey, _bgVal )
    @setStyleOfPart( 'bg', 'borderColor', _colors.text )
    @setStyleOfPart( 'value', 'color', _colors.text )
  refresh: ->
    @base()
    @refreshProperties() if @markupElemIds?
  refreshValue: ->
    @base()
    @adjustHeight() if @options.autoHeight

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rsence-pre-3.0.0.16 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.15 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.14 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.12 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.11 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.10 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.9 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.8 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.7 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.6 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.5 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.4 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.3 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.2 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.1 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-3.0.0.0 client/js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-2.3.0.26 js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-2.3.0.25 js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-2.3.0.24 js/chat/speech_bubble/speech_bubble.coffee
rsence-pre-2.3.0.23 js/chat/speech_bubble/speech_bubble.coffee