Fix html with native scroll

This commit is contained in:
Florian Mounier
2015-04-08 15:41:56 +02:00
parent 74193530df
commit 030cf6e70f
5 changed files with 53 additions and 37 deletions

View File

@@ -30,5 +30,13 @@ body[data-native-scroll="yes"]
#wrapper
overflow-y: auto
::-webkit-scrollbar
background: $bg
width: .5em
height: .5em
::-webkit-scrollbar-thumb
background: $fg
.terminal
outline: none

View File

@@ -16,10 +16,10 @@
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
@import font
@import layout
@import fx
@import colors
@import 16_colors
@import 256_colors
@import layout
@import cursor
@import term_styles

View File

@@ -63,36 +63,6 @@ body {
font-family: "SourceCodePro";
line-height: 1.2; }
/* *-* coding: utf-8 *-* */
/* This file is part of butterfly */
/* butterfly Copyright (C) 2014 Florian Mounier */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
html, body {
height: 100%;
margin: 0;
padding: 0;
line-height: 1.2; }
#wrapper {
height: 100%;
overflow: hidden;
white-space: nowrap; }
body[data-native-scroll="yes"] #wrapper {
overflow-y: auto; }
.terminal {
outline: none; }
/* *-* coding: utf-8 *-* */
/* This file is part of butterfly */
/* butterfly Copyright (C) 2014 Florian Mounier */
@@ -3030,6 +3000,42 @@ body[data-native-scroll="yes"] #wrapper {
.fg-color-257.reverse-video {
background-color: #f4ead5 !important; }
/* *-* coding: utf-8 *-* */
/* This file is part of butterfly */
/* butterfly Copyright (C) 2014 Florian Mounier */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
html, body {
height: 100%;
margin: 0;
padding: 0;
line-height: 1.2; }
#wrapper {
height: 100%;
overflow: hidden;
white-space: nowrap; }
body[data-native-scroll="yes"] #wrapper {
overflow-y: auto; }
body[data-native-scroll="yes"] ::-webkit-scrollbar {
background: #110f13;
width: .5em;
height: .5em; }
body[data-native-scroll="yes"] ::-webkit-scrollbar-thumb {
background: #f4ead5; }
.terminal {
outline: none; }
/* *-* coding: utf-8 *-* */
/* This file is part of butterfly */
/* butterfly Copyright (C) 2014 Florian Mounier */

View File

@@ -1115,13 +1115,14 @@
console.log("HTML escapes are disabled");
break;
}
html = "<div class=\"inline-html\">" + content + "</div>";
if (this.native_scroll) {
this.next_line();
html = document.createElement('div');
html.classList.add('inline-html');
html.innerHTML = content;
this.html[this.y] = html;
this.updateRange(this.y);
this.next_line();
} else {
html = "<div class=\"inline-html\">" + content + "</div>";
this.screen[this.y + this.ybase][this.x] = [this.curAttr, html];
line = 0;
while (line < this.get_html_height_in_lines(html) - 1) {

View File

@@ -1069,13 +1069,14 @@ class Terminal
console.log "HTML escapes are disabled"
break
html = "<div class=\"inline-html\">" + content + "</div>"
if @native_scroll
@next_line()
html = document.createElement 'div'
html.classList.add 'inline-html'
html.innerHTML = content
@html[@y] = html
@updateRange @y
@next_line()
else
html = "<div class=\"inline-html\">" + content + "</div>"
@screen[@y + @ybase][@x] = [
@curAttr
html