MCPcopy Index your code
hub / github.com/DHTMLX/gantt / Display

Function Display

samples/common/codehighlight/codemirror.js:4338–4438  ·  view source on GitHub ↗
(place, doc, input, options)

Source from the content-addressed store, hash-verified

4336 // display-related state.
4337
4338 function Display(place, doc, input, options) {
4339 var d = this;
4340 this.input = input;
4341
4342 // Covers bottom-right square when both scrollbars are present.
4343 d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
4344 d.scrollbarFiller.setAttribute("cm-not-content", "true");
4345 // Covers bottom of gutter when coverGutterNextToScrollbar is on
4346 // and h scrollbar is present.
4347 d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
4348 d.gutterFiller.setAttribute("cm-not-content", "true");
4349 // Will contain the actual code, positioned to cover the viewport.
4350 d.lineDiv = eltP("div", null, "CodeMirror-code");
4351 // Elements are added to these to represent selection and cursors.
4352 d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
4353 d.cursorDiv = elt("div", null, "CodeMirror-cursors");
4354 // A visibility: hidden element used to find the size of things.
4355 d.measure = elt("div", null, "CodeMirror-measure");
4356 // When lines outside of the viewport are measured, they are drawn in this.
4357 d.lineMeasure = elt("div", null, "CodeMirror-measure");
4358 // Wraps everything that needs to exist inside the vertically-padded coordinate system
4359 d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
4360 null, "position: relative; outline: none");
4361 var lines = eltP("div", [d.lineSpace], "CodeMirror-lines");
4362 // Moved around its parent to cover visible view.
4363 d.mover = elt("div", [lines], null, "position: relative");
4364 // Set to the height of the document, allowing scrolling.
4365 d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
4366 d.sizerWidth = null;
4367 // Behavior of elts with overflow: auto and padding is
4368 // inconsistent across browsers. This is used to ensure the
4369 // scrollable area is big enough.
4370 d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;");
4371 // Will contain the gutters, if any.
4372 d.gutters = elt("div", null, "CodeMirror-gutters");
4373 d.lineGutter = null;
4374 // Actual scrollable element.
4375 d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
4376 d.scroller.setAttribute("tabIndex", "-1");
4377 // The element in which the editor lives.
4378 d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
4379
4380 // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
4381 if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
4382 if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
4383
4384 if (place) {
4385 if (place.appendChild) { place.appendChild(d.wrapper); }
4386 else { place(d.wrapper); }
4387 }
4388
4389 // Current rendered range (may be bigger than the view window).
4390 d.viewFrom = d.viewTo = doc.first;
4391 d.reportedViewFrom = d.reportedViewTo = doc.first;
4392 // Information about the rendered lines.
4393 d.view = [];
4394 d.renderedView = null;
4395 // Holds info about a single rendered line when it was rendered

Callers

nothing calls this directly

Calls 5

eltFunction · 0.85
eltPFunction · 0.85
getGuttersFunction · 0.85
renderGuttersFunction · 0.85
initMethod · 0.65

Tested by

no test coverage detected