       attributes: true
       subtree: true
     observer.observe(target, options)
+  componentDidUpdate: ->
+    setTimeout =>
+      @alertWidth = document.getElementById('alert-container').offsetWidth
+    , 350
+    if @needUpdate then @handleAlertChanged()
+    @needUpdate = false
   componentWillUnmount: ->
     window.removeEventListener 'poi.alert', @handleAlert
     window.removeEventListener 'alert.change', @alertWidthChange

    overflow: false
    messagewidth: 0

  updateAlert: (e, overflow) ->
    displayMessage = @message
    @setState
      message: displayMessage
      overflowAnim: if overflow then 'overflow-anim' else ''

  alertWidthChange: (e) ->
    if @state.overflowAnim isnt ''
      @message = @messageOld
    @updateAlert()

  handleMessageScroll: (overflow) ->
    overflowed = @state.overflowAnim isnt ''
    return if overflow is overflowed
    if overflow
      @messageOld = @message
      if React.isValidElement @message
        @message = <span>{@message}<span>　　　　　</span>{@message}<span>　　　　　</span></span>
      else

  handleAlertChanged: (e) ->
    @setState
      messageWidth: document.getElementById('alert-area').offsetWidth
    contentWidth = document.getElementById('alert-area').offsetWidth
    overflow = @alertWidth < contentWidth
    @handleMessageScroll(overflow)

  handleAlert: (e) ->
