Updated codemirror to support panel and match-highlighter and revert some unnecessary changes

This commit is contained in:
Wu Cheng-Han 2015-09-24 13:57:10 +08:00
parent 33cdec2fd4
commit 6e40df2887
8 changed files with 27 additions and 23 deletions

View file

@ -29,4 +29,5 @@
.CodeMirror-dialog button {
font-size: 70%;
color: black;
}

View file

@ -97,7 +97,7 @@
var height = Math.max(bottom - top, 3);
var elt = frag.appendChild(document.createElement("div"));
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth * 2, 2) + "px; top: "
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth * 1.5, 2) + "px; top: "
+ (top + this.buttonHeight) + "px; height: " + height + "px";
elt.className = this.options.className;
}

View file

@ -15,7 +15,7 @@
.CodeMirror-simplescroll-horizontal {
bottom: 0; left: 0;
height: 8px;
height: 6px;
}
.CodeMirror-simplescroll-horizontal div {
bottom: 0;
@ -24,7 +24,7 @@
.CodeMirror-simplescroll-vertical {
right: 0; top: 0;
width: 8px;
width: 6px;
}
.CodeMirror-simplescroll-vertical div {
right: 0;
@ -39,8 +39,8 @@
.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
position: absolute;
background: #ccc;
border-radius: 3px;
margin: 2px;
border-radius: 7px;
border: 2px solid #222;
}
.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
@ -50,7 +50,7 @@
.CodeMirror-overlayscroll-horizontal {
bottom: 0; left: 0;
height: 6px;
height: 10px;
}
.CodeMirror-overlayscroll-horizontal div {
bottom: 0;
@ -58,8 +58,8 @@
}
.CodeMirror-overlayscroll-vertical {
right: 0; top: 0;
width: 6px;
right: 0px; top: 0px;
width: 10px;
}
.CodeMirror-overlayscroll-vertical div {
right: 0;

View file

@ -75,13 +75,14 @@
this.screen = clientSize;
this.total = scrollSize;
this.size = barSize;
var buttonSize = this.screen * (this.size / this.total);
if (buttonSize < minButtonSize) {
this.size -= minButtonSize - buttonSize;
buttonSize = minButtonSize;
}
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
(buttonSize - 4) + "px";
buttonSize + "px";
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
this.pos * (this.size / this.total) + "px";
};

View file

@ -1,7 +1,6 @@
.CodeMirror-search-match {
background: gold;
border-top: 1px solid orange;
border-bottom: 1px solid orange;
border: 1px solid orange;
-moz-box-sizing: border-box;
box-sizing: border-box;
opacity: .5;

File diff suppressed because one or more lines are too long

View file

@ -7,8 +7,10 @@ addon/selection/active-line.js \
addon/search/searchcursor.js \
addon/search/search.js \
addon/search/matchesonscrollbar.js \
addon/search/match-highlighter.js \
addon/scroll/simplescrollbars.js \
addon/scroll/annotatescrollbar.js \
addon/display/panel.js \
addon/dialog/dialog.js \
addon/edit/matchbrackets.js \
addon/edit/closebrackets.js \

View file

@ -388,7 +388,7 @@
viewWidth: d.wrapper.clientWidth,
barLeft: cm.options.fixedGutter ? gutterW : 0,
docHeight: docH,
scrollHeight: docH + scrollGap(cm) + d.barHeight + textHeight(cm.display),
scrollHeight: docH + scrollGap(cm) + d.barHeight,
nativeBarWidth: d.nativeBarWidth,
gutterWidth: gutterW
};