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


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

    目录

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

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

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

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

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

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

     function focusInput() {

                if (!options.readOnly) input.focus();

            }

            function scrollEditorIntoView() {

                if (!cursor.getBoundingClientRect) return;

                var rect = cursor.getBoundingClientRect();

                // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden

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

                if (ie && rect.top == rect.bottom) return;

                var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);

                if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView();

            }

            function scrollCursorIntoView() {

                var cursor = localCoords(sel.inverted ? sel.from : sel.to);

                var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x;

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

                return scrollIntoView(x, cursor.y, x, cursor.yBot);

            }

            function scrollIntoView(x1, y1, x2, y2) {

                var pl = paddingLeft(), pt = paddingTop(), lh = textHeight();

                y1 += pt; y2 += pt; x1 += pl; x2 += pl;

                var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true;

                if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;}

                else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;}

                var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft;

                var gutterw = options.fixedGutter ? gutter.clientWidth : 0;

                if (x1 < screenleft + gutterw) {

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

                    if (x1 < 50) x1 = 0;

                    scroller.scrollLeft = Math.max(0, x1 - 10 - gutterw);

                    scrolled = true;

                }

                else if (x2 > screenw + screenleft - 3) {

                    scroller.scrollLeft = x2 + 10 - screenw;

                    scrolled = true;

                    if (x2 > code.clientWidth) result = false;

                }

                if (scrolled && options.onScroll) options.onScroll(instance);

                return result;

            }

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

            function visibleLines() {

                var lh = textHeight(), top = scroller.scrollTop - paddingTop();

                var from_height = Math.max(0, Math.floor(top / lh));

                var to_height = Math.ceil((top + scroller.clientHeight) / lh);

                return {from: lineAtHeight(doc, from_height),

                    to: lineAtHeight(doc, to_height)};

            }

  • 相关阅读:
    SpringBoot 时 jar 报错 没有主清单属性
    C++11 thread_local关键字
    状态(State)模式
    猿创征文|Android 10.0 SystemUI状态栏隐藏搜狗输入法图标方法
    增强现实基础介绍
    Java项目之“拼图小游戏”
    R语言和医学统计学(6):重复测量方差分析
    循环结构综合实训(新)
    TypeScript高级类型
    存在负权边的单源最短路径的原理和C++实现
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132678331