chat designer: make preview readjust on resize
This commit is contained in:
parent
f2da497901
commit
7b0cc0e97f
2 changed files with 12 additions and 1 deletions
|
@ -143,6 +143,12 @@ class App.ChannelChat extends App.Controller
|
|||
@adjustBrowserWidth()
|
||||
@updateParams()
|
||||
|
||||
# bind adjustBrowserWidth with parameter animate = false
|
||||
$(window).on 'resize.chat-designer', => @adjustBrowserWidth false
|
||||
|
||||
release: ->
|
||||
$(window).off 'resize.chat-designer'
|
||||
|
||||
selectBrowserWidth: (event) =>
|
||||
tab = $(event.target).closest('[data-value]')
|
||||
|
||||
|
@ -151,12 +157,13 @@ class App.ChannelChat extends App.Controller
|
|||
@browserWidth = tab.attr('data-value')
|
||||
@adjustBrowserWidth()
|
||||
|
||||
adjustBrowserWidth: ->
|
||||
adjustBrowserWidth: (animate = true) =>
|
||||
width = parseInt @browserWidth, 10
|
||||
|
||||
# reset zoom
|
||||
@chat
|
||||
.removeClass('is-fullscreen')
|
||||
.toggleClass('no-transition', !animate)
|
||||
.css 'transform', "translateY(#{ @getChatOffset() }px)"
|
||||
@browser.css('width', '')
|
||||
@website.css
|
||||
|
|
|
@ -7512,6 +7512,10 @@ output {
|
|||
transition: 500ms;
|
||||
user-select: none;
|
||||
will-change: transform;
|
||||
|
||||
&.no-transition {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.zammad-chat-welcome {
|
||||
display: block !important;
|
||||
|
|
Loading…
Reference in a new issue