refactor ticket:openTextarea
This commit is contained in:
parent
bd364bcb93
commit
c5e23bb635
1 changed files with 49 additions and 47 deletions
|
@ -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
|
||||||
|
|
||||||
if withoutAnimation
|
duration = 300
|
||||||
duration = 0
|
|
||||||
|
|
||||||
@articleNewEdit.addClass('is-open')
|
if withoutAnimation
|
||||||
|
duration = 0
|
||||||
|
|
||||||
@textarea.velocity
|
@articleNewEdit.addClass('is-open')
|
||||||
properties:
|
|
||||||
minHeight: "#{ @textareaHeight.open - 38 }px"
|
|
||||||
options:
|
|
||||||
duration: duration
|
|
||||||
easing: 'easeOutQuad'
|
|
||||||
complete: => @addTextareaCatcher()
|
|
||||||
|
|
||||||
@textBubble.velocity
|
@textarea.velocity
|
||||||
properties:
|
properties:
|
||||||
paddingBottom: 28
|
minHeight: "#{ @textareaHeight.open - 38 }px"
|
||||||
options:
|
options:
|
||||||
duration: duration
|
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')
|
||||||
|
|
Loading…
Reference in a new issue