refactor ticket:openTextarea

This commit is contained in:
Felix Niklas 2015-10-23 16:29:39 +02:00
parent bd364bcb93
commit c5e23bb635

View file

@ -368,62 +368,64 @@ class App.TicketZoomArticleNew extends App.Controller
@removeTextareaCatcher() @removeTextareaCatcher()
openTextarea: (event, withoutAnimation) => openTextarea: (event, withoutAnimation) =>
if !@articleNewEdit.hasClass('is-open') if @articleNewEdit.hasClass('is-open')
duration = 300 return
duration = 300
if withoutAnimation if withoutAnimation
duration = 0 duration = 0
@articleNewEdit.addClass('is-open') @articleNewEdit.addClass('is-open')
@textarea.velocity @textarea.velocity
properties: properties:
minHeight: "#{ @textareaHeight.open - 38 }px" minHeight: "#{ @textareaHeight.open - 38 }px"
options: options:
duration: duration duration: duration
easing: 'easeOutQuad'
complete: => @addTextareaCatcher()
@textBubble.velocity
properties:
paddingBottom: 28
options:
duration: duration
easing: 'easeOutQuad'
# scroll to bottom
@textarea.velocity 'scroll',
container: @textarea.scrollParent()
offset: 99999
duration: 300
easing: 'easeOutQuad' easing: 'easeOutQuad'
queue: false complete: => @addTextareaCatcher()
@editControlItem @textBubble.velocity
.removeClass('is-hidden') properties:
.velocity paddingBottom: 28
properties: options:
opacity: [ 1, 0 ] duration: duration
translateX: [ 0, 20 ] easing: 'easeOutQuad'
translateZ: 0
options:
duration: 300
stagger: 50
drag: true
# move attachment text to the left bottom (bottom happens automatically) # scroll to bottom
@attachmentPlaceholder.velocity @textarea.velocity 'scroll',
container: @textarea.scrollParent()
offset: 99999
duration: 300
easing: 'easeOutQuad'
queue: false
@editControlItem
.removeClass('is-hidden')
.velocity
properties: properties:
translateX: -@attachmentInputHolder.position().left + 'px' opacity: [ 1, 0 ]
translateX: [ 0, 20 ]
translateZ: 0
options: options:
duration: duration duration: 300
easing: 'easeOutQuad' stagger: 50
drag: true
@attachmentHint.velocity # move attachment text to the left bottom (bottom happens automatically)
properties: @attachmentPlaceholder.velocity
opacity: 0 properties:
options: translateX: -@attachmentInputHolder.position().left + 'px'
duration: duration options:
duration: duration
easing: 'easeOutQuad'
@attachmentHint.velocity
properties:
opacity: 0
options:
duration: duration
addTextareaCatcher: => addTextareaCatcher: =>
if @articleNewEdit.is(':visible') if @articleNewEdit.is(':visible')