openapi: inherit RTL setting from Hugo content #600

This commit is contained in:
Sören Weber 2023-07-27 21:17:43 +02:00
parent 34b1347acd
commit e44a96cb22
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -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 + '">' +