mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
fix: delete file
This commit is contained in:
parent
10712bce17
commit
56d961d9fa
@ -1,23 +0,0 @@
|
|||||||
// 左右栏同步滚动
|
|
||||||
$(document).ready(() => {
|
|
||||||
let timeout;
|
|
||||||
$('div.CodeMirror-scroll, #preview').on("scroll", function callback() {
|
|
||||||
clearTimeout(timeout);
|
|
||||||
|
|
||||||
let source = $(this),
|
|
||||||
target = $(source.is("#preview") ? 'div.CodeMirror-scroll' : '#preview');
|
|
||||||
|
|
||||||
target.off("scroll");
|
|
||||||
|
|
||||||
let source0 = source[0];
|
|
||||||
let target0 = target[0];
|
|
||||||
|
|
||||||
let percentage = source0.scrollTop / (source0.scrollHeight - source0.offsetHeight);
|
|
||||||
let height = percentage * (target0.scrollHeight - target0.offsetHeight);
|
|
||||||
target0.scrollTo(0, height);
|
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
|
||||||
target.on("scroll", callback);
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
});
|
|
@ -60,7 +60,7 @@ import {
|
|||||||
} from '../scripts/util'
|
} from '../scripts/util'
|
||||||
|
|
||||||
require('codemirror/mode/javascript/javascript')
|
require('codemirror/mode/javascript/javascript')
|
||||||
import $ from 'jquery'
|
// import $ from 'jquery'
|
||||||
import config from '../scripts/config'
|
import config from '../scripts/config'
|
||||||
import {mapState, mapMutations} from 'vuex';
|
import {mapState, mapMutations} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
@ -201,10 +201,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 左右栏同步滚动
|
// 左右栏同步滚动
|
||||||
leftAndRightScroll() {
|
leftAndRightScroll() {
|
||||||
$('#preview').on('scroll', function callback() {
|
const _this = this;
|
||||||
clearTimeout(this.timeout)
|
|
||||||
|
|
||||||
let source = $(this)
|
document.getElementById('preview').addEventListener("scroll", function callback() {
|
||||||
|
clearTimeout(_this.timeout)
|
||||||
|
|
||||||
|
let source = $(_this)
|
||||||
let target = $(source.is('#preview') ? 'div.CodeMirror-scroll' : '#preview')
|
let target = $(source.is('#preview') ? 'div.CodeMirror-scroll' : '#preview')
|
||||||
|
|
||||||
target.off('scroll')
|
target.off('scroll')
|
||||||
@ -216,14 +218,13 @@ export default {
|
|||||||
let height = percentage * (target0.scrollHeight - target0.offsetHeight)
|
let height = percentage * (target0.scrollHeight - target0.offsetHeight)
|
||||||
target0.scrollTo(0, height)
|
target0.scrollTo(0, height)
|
||||||
|
|
||||||
this.timeout = setTimeout(() => {
|
_this.timeout = setTimeout(() => {
|
||||||
target.on('scroll', callback)
|
target.on('scroll', callback)
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
}, true);
|
||||||
},
|
},
|
||||||
onEditorRefresh() {
|
onEditorRefresh() {
|
||||||
this.editorRefresh();
|
this.editorRefresh();
|
||||||
// setTimeout(()=> PR.prettyPrint(), 0);
|
|
||||||
},
|
},
|
||||||
endCopy() {
|
endCopy() {
|
||||||
this.backLight = false;
|
this.backLight = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user