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

Function autoFixedHandle

static/editor.md/editormd.amd.js:1135–1160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1133 }
1134
1135 var autoFixedHandle = function(){
1136 var $window = $(window);
1137 var top = $window.scrollTop();
1138
1139 if (!settings.toolbarAutoFixed)
1140 {
1141 return false;
1142 }
1143
1144 if (top - editor.offset().top > 10 && top < editor.height())
1145 {
1146 toolbar.css({
1147 position : "fixed",
1148 width : editor.width() + "px",
1149 left : ($window.width() - editor.width()) / 2 + "px"
1150 });
1151 }
1152 else
1153 {
1154 toolbar.css({
1155 position : "absolute",
1156 width : "100%",
1157 left : 0
1158 });
1159 }
1160 };
1161
1162 if (!state.fullscreen && !state.preview && settings.toolbar && settings.toolbarAutoFixed)
1163 {

Callers

nothing calls this directly

Calls 1

$Function · 0.50

Tested by

no test coverage detected