chat designer: make preview readjust on resize

This commit is contained in:
Felix Niklas 2015-11-25 13:59:08 +01:00
parent f2da497901
commit 7b0cc0e97f
2 changed files with 12 additions and 1 deletions

View file

@ -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

View file

@ -7512,6 +7512,10 @@ output {
transition: 500ms;
user-select: none;
will-change: transform;
&.no-transition {
transition: none;
}
.zammad-chat-welcome {
display: block !important;