Skip to content

Commit

Permalink
openapi: inherit RTL setting from Hugo content #600
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Jul 27, 2023
1 parent 34b1347 commit e44a96c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ else{
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );

var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
var lang = document.querySelector( 'html' ).getAttribute( 'lang' );
var dir_padding_start = 'padding-left';
var dir_padding_end = 'padding-right';
var dir_key_start = 37;
Expand Down Expand Up @@ -341,7 +342,7 @@ function initOpenapi( update, attrs ){
oi.classList.toggle('sc-openapi-iframe', true);
oi.srcdoc =
'<!doctype html>' +
'<html lang="en">' +
'<html lang="' + lang + '" dir="' + (isRtl ? 'rtl' : 'ltr') + '">' +
'<head>' +
'<link rel="stylesheet" href="' + window.themeUseOpenapi.css + '">' +
'<link rel="stylesheet" href="' + theme + '">' +
Expand Down

0 comments on commit e44a96c

Please sign in to comment.