MCPcopy Create free account
hub / github.com/TruthHun/BookStack / autoFixedHandle

Function autoFixedHandle

static/editor.md/editormd.js:1098–1123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1096 }
1097
1098 var autoFixedHandle = function(){
1099 var $window = $(window);
1100 var top = $window.scrollTop();
1101
1102 if (!settings.toolbarAutoFixed)
1103 {
1104 return false;
1105 }
1106
1107 if (top - editor.offset().top > 10 && top < editor.height())
1108 {
1109 toolbar.css({
1110 position : "fixed",
1111 width : editor.width() + "px",
1112 left : ($window.width() - editor.width()) / 2 + "px"
1113 });
1114 }
1115 else
1116 {
1117 toolbar.css({
1118 position : "absolute",
1119 width : "100%",
1120 left : 0
1121 });
1122 }
1123 };
1124
1125 if (!state.fullscreen && !state.preview && settings.toolbar && settings.toolbarAutoFixed)
1126 {

Callers

nothing calls this directly

Calls 1

$Function · 0.50

Tested by

no test coverage detected