跳到主要内容

Getting viewport settings

Starting from version 8.1, you can get the viewport settings of the desktop editors. This method is used to set the space between the top panel and the Desktop Editors widget.

window.AscDesktopEditor.getViewportSettings();

This method returns an object with the following parameters:

{ 
"widgetType": "window",
"captionHeight": 100
}
ParameterTypeExampleDescription
widgetTypestring"window"The widget type ("window" or "tab").
captionHeightinteger100The caption height.

You can also subscribe to the onViewportSettingsChanged event which is called every time the viewport settings are changed:

window.AscDesktopEditor.attachEvent("onViewportSettingsChanged", () => {
console.log("The viewport settings have been changed.");
});