     window.removeEventListener 'game.start', adjustSize
     window.removeEventListener 'game.payitem', adjustPayitem
     $('kan-game webview').removeEventListener 'page-title-set', handleTitleSet
-    $('kan-game #webview-wrapper')?.style?.height = $('kan-game webview')?.style?.height = $('kan-game webview /deep/ object[is=browserplugin]')?.style?.height = "#{window.innerWidth / 800.0 * 480.0 - 5}px"
+    adjustWebviewHeight "#{window.innerWidth / 800.0 * 480.0 - 5}px"
     $('kan-game #webview-wrapper')?.style?.width = ""
     $('kan-game #webview-wrapper')?.style?.marginLeft = ""
     window._delay = true

{$, $$} = window

# Initial
$('kan-game webview')?.style?.height = $('kan-game webview /deep/ object[is=browserplugin]')?.style?.height = "#{window.innerWidth / 800.0 * 480.0}px"
$('#layout-css').setAttribute 'href', "./assets/css/layout.vertical.css"

# Layout
adjustSize = ->
  webview = $('kan-game webview')
  poiapp = document.getElementsByTagName('poi-app')[0]

  factor = Math.ceil(window.innerWidth /  800.0 * 100) / 100.0
  if window.webviewWidth != -1
    factor = Math.ceil(window.webviewWidth / 800.0 * 100) / 100.0
  poiapp?.style?.height = "#{window.innerHeight - Math.ceil(480.0 * factor) - poiControlHeight}px"
  [].forEach.call $$('poi-app div.poi-app-tabpane'), (e) ->
    e.style.height = "#{(window.innerHeight - Math.ceil(480.0 * factor) - poiControlHeight) / window.zoomLevel - 40}px"
    e.style.overflowY = "scroll"
  if window.webviewWidth > window.innerWidth
    nowWindow = remote.getCurrentWindow()
