• 笙默考试管理系统-MyExamTest----codemirror(16)


    笙默考试管理系统-MyExamTest----codemirror(16

    目录

    一、 笙默考试管理系统-MyExamTest----codemirror

    二、 笙默考试管理系统-MyExamTest----codemirror

    三、 笙默考试管理系统-MyExamTest----codemirror

    四、 笙默考试管理系统-MyExamTest----codemirror

    五、 笙默考试管理系统-MyExamTest----codemirror

    • 笙默考试管理系统-MyExamTest----codemirror

       // Uses a set of changes plus the current scroll position to

            // determine which DOM updates have to be made, and makes the

            // updates.

            function updateDisplay(changes, suppressCallback) {

                if (!scroller.clientWidth) {

                    showingFrom = showingTo = displayOffset = 0;

                    return;

                }

    • 笙默考试管理系统-MyExamTest----codemirror

                // Compute the new visible window

                var visible = visibleLines();

                // Bail out if the visible area is already rendered and nothing changed.

                if (changes !== true && changes.length == 0 && visible.from >= showingFrom && visible.to <= showingTo) return;

                var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);

                if (showingFrom < from && from - showingFrom < 20) from = showingFrom;

                if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);

    • 笙默考试管理系统-MyExamTest----codemirror

                // Create a range of theoretically intact lines, and punch holes

                // in that using the change info.

                var intact = changes === true ? [] :

                    computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);

                // Clip off the parts that won't be visible

                var intactLines = 0;

                for (var i = 0; i < intact.length; ++i) {

                    var range = intact[i];

                    if (range.from < from) {range.domStart += (from - range.from); range.from = from;}

    • 笙默考试管理系统-MyExamTest----codemirror

                    if (range.to > to) range.to = to;

                    if (range.from >= range.to) intact.splice(i--, 1);

                    else intactLines += range.to - range.from;

                }

                if (intactLines == to - from) return;

                intact.sort(function(a, b) {return a.domStart - b.domStart;});

    • 笙默考试管理系统-MyExamTest----codemirror

                var th = textHeight(), gutterDisplay = gutter.style.display;

                lineDiv.style.display = gutter.style.display = "none";

                patchDisplay(from, to, intact);

                lineDiv.style.display = "";

                // Position the mover div to align with the lines it's supposed

                // to be showing (which will cover the visible display)

                var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;

                // This is just a bogus formula that detects when the editor is

                // resized or the font size changes.

                if (different) lastSizeC = scroller.clientHeight + th;

                showingFrom = from; showingTo = to;

                displayOffset = heightAtLine(doc, from);

                mover.style.top = (displayOffset * th) + "px";

                code.style.height = (doc.height * th + 2 * paddingTop()) + "px";

  • 相关阅读:
    [极客大挑战 2019]HardSQL-1
    从底层原理看Android的序列化是如何实现的
    Android View 触摸反馈原理浅析
    【线性代数】P5 矩阵定义和性质
    基于ECS搭建云上博客
    作为公司测开岗的面试官,我是怎么选人的....
    使用了百度OCR,记录一下
    PyTorch学习笔记-Torchvision数据集使用方法
    Autosar Dem配置-Condition(TRC)的使用-基于ETAS软件
    linux 内存检测工具 kfence 详解(二)
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132678349