mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-08-17 03:42:24 +00:00
deploy: 99f33318a2
This commit is contained in:
parent
1a5f1849ff
commit
8bedab3877
302 changed files with 7768 additions and 22047 deletions
js
19
js/theme.js
19
js/theme.js
|
@ -1,15 +1,6 @@
|
|||
window.relearn = window.relearn || {};
|
||||
|
||||
var theme = true;
|
||||
var isIE = /*@cc_on!@*/false || !!document.documentMode;
|
||||
if( isIE ){
|
||||
// we don't support sidebar flyout in IE
|
||||
document.querySelector( 'body' ).classList.remove( 'mobile-support' );
|
||||
}
|
||||
else{
|
||||
document.querySelector( 'body' ).classList.add( 'mobile-support' );
|
||||
}
|
||||
|
||||
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );
|
||||
|
||||
var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
|
||||
|
@ -19,7 +10,7 @@ var dir_padding_end = 'padding-right';
|
|||
var dir_key_start = 37;
|
||||
var dir_key_end = 39;
|
||||
var dir_scroll = 1;
|
||||
if( isRtl && !isIE ){
|
||||
if( isRtl ){
|
||||
dir_padding_start = 'padding-right';
|
||||
dir_padding_end = 'padding-left';
|
||||
dir_key_start = 39;
|
||||
|
@ -357,10 +348,6 @@ function initMermaid( update, attrs ) {
|
|||
}
|
||||
|
||||
function initOpenapi( update, attrs ){
|
||||
if( isIE ){
|
||||
return;
|
||||
}
|
||||
|
||||
var state = this;
|
||||
if( update && !state.is_initialized ){
|
||||
return;
|
||||
|
@ -1569,10 +1556,6 @@ function updateTheme( detail ){
|
|||
})();
|
||||
|
||||
function useMermaid( config ){
|
||||
if( !Object.assign ){
|
||||
// We don't support Mermaid for IE11 anyways, so bail out early
|
||||
return;
|
||||
}
|
||||
window.relearn.mermaidConfig = config;
|
||||
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
||||
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue