| 1281 | } |
| 1282 | |
| 1283 | function scrollToBottom () { |
| 1284 | if (appState.currentMode === modeType.both) { |
| 1285 | var scrollInfo = editor.getScrollInfo() |
| 1286 | var scrollHeight = scrollInfo.height |
| 1287 | if (scrollInfo.top !== scrollHeight) { editor.scrollTo(0, scrollHeight * 2) } else { |
| 1288 | ui.area.view.animate({ |
| 1289 | scrollTop: ui.area.view[0].scrollHeight |
| 1290 | }, 100, 'linear') |
| 1291 | } |
| 1292 | } else { |
| 1293 | $('body, html').stop(true, true).animate({ |
| 1294 | scrollTop: $(document.body)[0].scrollHeight |
| 1295 | }, 100, 'linear') |
| 1296 | } |
| 1297 | } |
| 1298 | |
| 1299 | window.scrollToTop = scrollToTop |
| 1300 | window.scrollToBottom = scrollToBottom |