- md5
- 55c05863608bc78cb48131f9e0f17cc3
- sha1
- 60a434f1b3b19ab9142f9b5e78749da0b845f7b9
- sha256
- ab311fc84fd951602f4d656749dc7dd6498bd80a051b929c51d349553d6bd700
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,o,i){function n(e){var o=t.wheelEventPixels(e)["horizontal"==s.orientation?"x":"y"],i=s.pos;s.moveTo(s.pos+o),s.pos!=i&&t.e_preventDefault(e)}this.orientation=o,this.scroll=i,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+o,this.inner=this.node.appendChild(document.createElement("div"));var s=this;t.on(this.inner,"mousedown",function(e){function o(){t.off(document,"mousemove",i),t.off(document,"mouseup",o)}function i(t){if(1!=t.which)return o();s.moveTo(h+(t[n]-r)*(s.total/s.size))}if(1==e.which){t.e_preventDefault(e);var n="horizontal"==s.orientation?"pageX":"pageY",r=e[n],h=s.pos;t.on(document,"mousemove",i),t.on(document,"mouseup",o)}}),t.on(this.node,"click",function(e){t.e_preventDefault(e);var o,i=s.inner.getBoundingClientRect();o="horizontal"==s.orientation?e.clientX<i.left?-1:e.clientX>i.right?1:0:e.clientY<i.top?-1:e.clientY>i.bottom?1:0,s.moveTo(s.pos+o*s.screen)}),t.on(this.node,"mousewheel",n),t.on(this.node,"DOMMouseScroll",n)}function o(t,o,i){this.addClass=t,this.horiz=new e(t,"horizontal",i),o(this.horiz.node),this.vert=new e(t,"vertical",i),o(this.vert.node),this.width=null}e.prototype.setPos=function(t,e){return t<0&&(t=0),t>this.total-this.screen&&(t=this.total-this.screen),!(!e&&t==this.pos)&&(this.pos=t,this.inner.style["horizontal"==this.orientation?"left":"top"]=t*(this.size/this.total)+"px",!0)},e.prototype.moveTo=function(t){this.setPos(t)&&this.scroll(t,this.orientation)};e.prototype.update=function(t,e,o){var i=this.screen!=e||this.total!=t||this.size!=o;i&&(this.screen=e,this.total=t,this.size=o);var n=this.screen*(this.size/this.total);n<10&&(this.size-=10-n,n=10),this.inner.style["horizontal"==this.orientation?"width":"height"]=n+"px",this.setPos(this.pos,i)},o.prototype.update=function(t){if(null==this.width){var e=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;e&&(this.width=parseInt(e.height))}var o=this.width||0,i=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=i?"block":"none",n&&(this.vert.update(t.scrollHeight,t.clientHeight,t.viewHeight-(i?o:0)),this.vert.node.style.bottom=i?o+"px":"0"),i&&(this.horiz.update(t.scrollWidth,t.clientWidth,t.viewWidth-(n?o:0)-t.barLeft),this.horiz.node.style.right=n?o+"px":"0",this.horiz.node.style.left=t.barLeft+"px"),{right:n?o:0,bottom:i?o:0}},o.prototype.setScrollTop=function(t){this.vert.setPos(t)},o.prototype.setScrollLeft=function(t){this.horiz.setPos(t)},o.prototype.clear=function(){var t=this.horiz.node.parentNode;t.removeChild(this.horiz.node),t.removeChild(this.vert.node)},t.scrollbarModel.simple=function(t,e){return new o("CodeMirror-simplescroll",t,e)},t.scrollbarModel.overlay=function(t,e){return new o("CodeMirror-overlayscroll",t,e)}});
No other release has this exact content. See every version of this file.