@ -2358,6 +2358,15 @@ class $e6c02983873e6cdf$var$TextEditor extends (0, $68b475f2a0292491$export$2e2b
//--------------------------
//--------------------------
constructor ( textEditor , scrollLimit ) {
constructor ( textEditor , scrollLimit ) {
super ( ) ;
super ( ) ;
document . querySelector ( '[role="text-editor-control"]' ) . addEventListener ( "scroll" , ( e ) => {
console . log ( "HERE" ) ;
} ) ;
document . body . addEventListener ( "scroll" , ( e ) => {
var fixLimit = scrollLimit ;
console . log ( "POSITION" , document . body . scrollTop + " : " + fixLimit ) ;
if ( document . body . scrollTop + 5 >= fixLimit ) document . querySelector ( '[role="text-editor-control"]' ) . classList . add ( "control-freeze" ) ;
else document . querySelector ( '[role="text-editor-control"]' ) . classList . remove ( "control-freeze" ) ;
} ) ;
document . getElementById ( "edit" ) . addEventListener ( "input" , ( e ) => {
document . getElementById ( "edit" ) . addEventListener ( "input" , ( e ) => {
let result _element = document . querySelector ( "#highlight-content" ) ;
let result _element = document . querySelector ( "#highlight-content" ) ;
this . textEditor = textEditor ;
this . textEditor = textEditor ;
@ -2378,12 +2387,7 @@ class $e6c02983873e6cdf$var$TextEditor extends (0, $68b475f2a0292491$export$2e2b
} ) ;
} ) ;
document . getElementById ( "edit" ) . dispatchEvent ( new Event ( "input" ) ) ;
document . getElementById ( "edit" ) . dispatchEvent ( new Event ( "input" ) ) ;
this . setInputs ( ) ;
this . setInputs ( ) ;
//freeze editor formatting so it doesn't scroll off screen
//freeze editor formatting so it doesn't scroll off screen
window . addEventListener ( "scroll" , ( ) => {
var fixLimit = scrollLimit ;
if ( window . pageYOffset + 5 >= fixLimit ) document . getElementById ( "edit-control" ) . style . position = "fixed" ;
else document . getElementById ( "edit-control" ) . style . position = "relative" ;
} ) ;
}
}
//--------------------------
//--------------------------
// methods
// methods