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 { .CodeMirror-dialog button {
font-size: 70%; font-size: 70%;
color: black;
} }

View File

@ -97,7 +97,7 @@
var height = Math.max(bottom - top, 3); var height = Math.max(bottom - top, 3);
var elt = frag.appendChild(document.createElement("div")); 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"; + (top + this.buttonHeight) + "px; height: " + height + "px";
elt.className = this.options.className; elt.className = this.options.className;
} }

View File

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

View File

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

View File

@ -1,7 +1,6 @@
.CodeMirror-search-match { .CodeMirror-search-match {
background: gold; background: gold;
border-top: 1px solid orange; border: 1px solid orange;
border-bottom: 1px solid orange;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
opacity: .5; 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/searchcursor.js \
addon/search/search.js \ addon/search/search.js \
addon/search/matchesonscrollbar.js \ addon/search/matchesonscrollbar.js \
addon/search/match-highlighter.js \
addon/scroll/simplescrollbars.js \ addon/scroll/simplescrollbars.js \
addon/scroll/annotatescrollbar.js \ addon/scroll/annotatescrollbar.js \
addon/display/panel.js \
addon/dialog/dialog.js \ addon/dialog/dialog.js \
addon/edit/matchbrackets.js \ addon/edit/matchbrackets.js \
addon/edit/closebrackets.js \ addon/edit/closebrackets.js \

View File

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