mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
openapi: inherit RTL setting from Hugo content #600
This commit is contained in:
parent
34b1347acd
commit
e44a96cb22
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@ else{
|
||||||
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );
|
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );
|
||||||
|
|
||||||
var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
|
var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
|
||||||
|
var lang = document.querySelector( 'html' ).getAttribute( 'lang' );
|
||||||
var dir_padding_start = 'padding-left';
|
var dir_padding_start = 'padding-left';
|
||||||
var dir_padding_end = 'padding-right';
|
var dir_padding_end = 'padding-right';
|
||||||
var dir_key_start = 37;
|
var dir_key_start = 37;
|
||||||
|
@ -341,7 +342,7 @@ function initOpenapi( update, attrs ){
|
||||||
oi.classList.toggle('sc-openapi-iframe', true);
|
oi.classList.toggle('sc-openapi-iframe', true);
|
||||||
oi.srcdoc =
|
oi.srcdoc =
|
||||||
'<!doctype html>' +
|
'<!doctype html>' +
|
||||||
'<html lang="en">' +
|
'<html lang="' + lang + '" dir="' + (isRtl ? 'rtl' : 'ltr') + '">' +
|
||||||
'<head>' +
|
'<head>' +
|
||||||
'<link rel="stylesheet" href="' + window.themeUseOpenapi.css + '">' +
|
'<link rel="stylesheet" href="' + window.themeUseOpenapi.css + '">' +
|
||||||
'<link rel="stylesheet" href="' + theme + '">' +
|
'<link rel="stylesheet" href="' + theme + '">' +
|
||||||
|
|
Loading…
Reference in a new issue