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