mirror of
https://github.com/clearml/clearml-docs
synced 2025-04-20 22:35:32 +00:00
47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import siteConfig from '@generated/docusaurus.config';
|
|
import mediumZoom from 'medium-zoom'
|
|
|
|
const {themeConfig} = siteConfig;
|
|
|
|
export default (function () {
|
|
|
|
if (typeof window === 'undefined') {
|
|
return null;
|
|
}
|
|
|
|
const selector = (themeConfig && themeConfig.zoomSelector) || '.markdown img';
|
|
|
|
setTimeout(() => {
|
|
mediumZoom(selector, {
|
|
margin: 48,
|
|
background: '#00000090',
|
|
}
|
|
);
|
|
}, 1000);
|
|
|
|
|
|
return {
|
|
onRouteUpdate({location}) {
|
|
|
|
if (location && location.hash && location.hash.length) {
|
|
return;
|
|
}
|
|
|
|
setTimeout(() => {
|
|
mediumZoom(selector, {
|
|
margin: 48,
|
|
background: '#00000090',
|
|
});
|
|
}, 1000);
|
|
|
|
},
|
|
};
|
|
})();
|