File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,7 +400,6 @@ $(document).ready(function () {
400400 clearMap ( ) ;
401401 }
402402 checkEditorStyle ( ) ;
403- changeMode ( currentMode ) ;
404403 /* we need this only on touch devices */
405404 if ( isTouchDevice ) {
406405 /* cache dom references */
@@ -423,13 +422,18 @@ $(document).ready(function () {
423422} ) ;
424423//when page resize
425424$ ( window ) . resize ( function ( ) {
425+ checkLayout ( ) ;
426+ checkEditorStyle ( ) ;
427+ checkTocStyle ( ) ;
428+ checkCursorMenu ( ) ;
429+ windowResize ( ) ;
426430} ) ;
427431//when page unload
428432$ ( window ) . unload ( function ( ) {
429- writeHistory ( ui . area . markdown ) ;
433+ updateHistoryInner ( ) ;
430434} ) ;
431435$ ( window ) . error ( function ( ) {
432- setNeedRefresh ( ) ;
436+ // setNeedRefresh();
433437} ) ;
434438
435439//when page hash change
@@ -460,9 +464,11 @@ var windowResizeDebounce = 200;
460464var windowResize = _ . debounce ( windowResizeInner , windowResizeDebounce ) ;
461465
462466function windowResizeInner ( ) {
467+ checkLayout ( ) ;
463468 checkResponsive ( ) ;
464469 checkEditorStyle ( ) ;
465470 checkTocStyle ( ) ;
471+ checkCursorMenu ( ) ;
466472 //refresh editor
467473 if ( loaded ) {
468474 editor . setOption ( 'viewportMargin' , Infinity ) ;
@@ -480,6 +486,11 @@ function windowResizeInner() {
480486 }
481487}
482488
489+ function checkLayout ( ) {
490+ var navbarHieght = $ ( '.navbar' ) . outerHeight ( ) ;
491+ $ ( 'body' ) . css ( 'padding-top' , navbarHieght + 'px' ) ;
492+ }
493+
483494function editorHasFocus ( ) {
484495 return $ ( editor . getInputField ( ) ) . is ( ":focus" ) ;
485496}
You can’t perform that action at this time.
0 commit comments