mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +08:00
Fix typo in variable
This commit is contained in:
parent
bf5dbbe3c5
commit
7d76ccb527
@ -46,9 +46,9 @@ export default class MathUI extends Plugin {
|
|||||||
this.formView.destroy();
|
this.formView.destroy();
|
||||||
|
|
||||||
// Destroy preview element
|
// Destroy preview element
|
||||||
const prewviewEl = global.document.getElementById( this._previewUid );
|
const previewEl = global.document.getElementById( this._previewUid );
|
||||||
if ( prewviewEl ) {
|
if ( previewEl ) {
|
||||||
prewviewEl.parentNode.removeChild( prewviewEl );
|
previewEl.parentNode.removeChild( previewEl );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ export default class MathUI extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show preview element
|
// Show preview element
|
||||||
const prewviewEl = global.document.getElementById( this._previewUid );
|
const previewEl = global.document.getElementById( this._previewUid );
|
||||||
if ( prewviewEl && this.formView.previewEnabled ) {
|
if ( previewEl && this.formView.previewEnabled ) {
|
||||||
// Force refresh preview
|
// Force refresh preview
|
||||||
this.formView.mathView.updateMath();
|
this.formView.mathView.updateMath();
|
||||||
}
|
}
|
||||||
@ -167,9 +167,9 @@ export default class MathUI extends Plugin {
|
|||||||
this._balloon.remove( this.formView );
|
this._balloon.remove( this.formView );
|
||||||
|
|
||||||
// Hide preview element
|
// Hide preview element
|
||||||
const prewviewEl = global.document.getElementById( this._previewUid );
|
const previewEl = global.document.getElementById( this._previewUid );
|
||||||
if ( prewviewEl ) {
|
if ( previewEl ) {
|
||||||
prewviewEl.style.visibility = 'hidden';
|
previewEl.style.visibility = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editor.editing.view.focus();
|
this.editor.editing.view.focus();
|
||||||
|
28
src/utils.js
28
src/utils.js
@ -116,7 +116,7 @@ export function getBalloonPositionData( editor ) {
|
|||||||
positions: [
|
positions: [
|
||||||
defaultPositions.southArrowNorth,
|
defaultPositions.southArrowNorth,
|
||||||
defaultPositions.southArrowNorthWest,
|
defaultPositions.southArrowNorthWest,
|
||||||
defaultPositions.southArrowNorthEast,
|
defaultPositions.southArrowNorthEast
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ export function getBalloonPositionData( editor ) {
|
|||||||
positions: [
|
positions: [
|
||||||
defaultPositions.southArrowNorth,
|
defaultPositions.southArrowNorth,
|
||||||
defaultPositions.southArrowNorthWest,
|
defaultPositions.southArrowNorthWest,
|
||||||
defaultPositions.southArrowNorthEast,
|
defaultPositions.southArrowNorthEast
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -135,8 +135,8 @@ export function getBalloonPositionData( editor ) {
|
|||||||
|
|
||||||
function selectRenderMode( element, preview, previewUid, cb ) {
|
function selectRenderMode( element, preview, previewUid, cb ) {
|
||||||
if ( preview ) {
|
if ( preview ) {
|
||||||
createPreviewElement( element, previewUid, prewviewEl => {
|
createPreviewElement( element, previewUid, previewEl => {
|
||||||
cb( prewviewEl );
|
cb( previewEl );
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
cb( element );
|
cb( element );
|
||||||
@ -173,25 +173,25 @@ function renderMathJax2( equation, element, display ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createPreviewElement( element, previewUid, render ) {
|
function createPreviewElement( element, previewUid, render ) {
|
||||||
const prewviewEl = getPreviewElement( element, previewUid );
|
const previewEl = getPreviewElement( element, previewUid );
|
||||||
render( prewviewEl );
|
render( previewEl );
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPreviewElement( element, previewUid ) {
|
function getPreviewElement( element, previewUid ) {
|
||||||
let prewviewEl = global.document.getElementById( previewUid );
|
let previewEl = global.document.getElementById( previewUid );
|
||||||
// Create if not found
|
// Create if not found
|
||||||
if ( !prewviewEl ) {
|
if ( !previewEl ) {
|
||||||
prewviewEl = global.document.createElement( 'div' );
|
previewEl = global.document.createElement( 'div' );
|
||||||
prewviewEl.setAttribute( 'id', previewUid );
|
previewEl.setAttribute( 'id', previewUid );
|
||||||
prewviewEl.style.visibility = 'hidden';
|
previewEl.style.visibility = 'hidden';
|
||||||
global.document.body.appendChild( prewviewEl );
|
global.document.body.appendChild( previewEl );
|
||||||
|
|
||||||
let ticking = false;
|
let ticking = false;
|
||||||
|
|
||||||
const renderTransformation = () => {
|
const renderTransformation = () => {
|
||||||
if ( !ticking ) {
|
if ( !ticking ) {
|
||||||
global.window.requestAnimationFrame( () => {
|
global.window.requestAnimationFrame( () => {
|
||||||
moveElement( element, prewviewEl );
|
moveElement( element, previewEl );
|
||||||
ticking = false;
|
ticking = false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ function getPreviewElement( element, previewUid ) {
|
|||||||
global.window.addEventListener( 'resize', renderTransformation );
|
global.window.addEventListener( 'resize', renderTransformation );
|
||||||
global.window.addEventListener( 'scroll', renderTransformation );
|
global.window.addEventListener( 'scroll', renderTransformation );
|
||||||
}
|
}
|
||||||
return prewviewEl;
|
return previewEl;
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveAndScaleElement( parent, child ) {
|
function moveAndScaleElement( parent, child ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user