mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
i18n: write code ltr even for rtl languages #492
This commit is contained in:
parent
c0a1c9cbcb
commit
27bb276909
2 changed files with 5 additions and 6 deletions
|
@ -548,10 +548,11 @@ pre {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre.pre-code,
|
/* pre:has( code ), */
|
||||||
pre:has( code ){
|
/* the :has() operator isn't available in FF yet, so we patch this by JS */
|
||||||
/* the :has() operator isn't available in FF yet, so we patch this by JS */
|
pre.pre-code {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
|
|
|
@ -368,13 +368,11 @@ function initCodeClipboard(){
|
||||||
|
|
||||||
clip.on( 'success', function( e ){
|
clip.on( 'success', function( e ){
|
||||||
e.clearSelection();
|
e.clearSelection();
|
||||||
var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre';
|
|
||||||
e.trigger.setAttribute( 'aria-label', window.T_Copied_to_clipboard );
|
e.trigger.setAttribute( 'aria-label', window.T_Copied_to_clipboard );
|
||||||
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
||||||
});
|
});
|
||||||
|
|
||||||
clip.on( 'error', function( e ){
|
clip.on( 'error', function( e ){
|
||||||
var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre';
|
|
||||||
e.trigger.setAttribute( 'aria-label', fallbackMessage(e.action) );
|
e.trigger.setAttribute( 'aria-label', fallbackMessage(e.action) );
|
||||||
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) );
|
||||||
var f = function(){
|
var f = function(){
|
||||||
|
@ -388,7 +386,7 @@ function initCodeClipboard(){
|
||||||
code.classList.add( 'copy-to-clipboard-code' );
|
code.classList.add( 'copy-to-clipboard-code' );
|
||||||
if( inPre ){
|
if( inPre ){
|
||||||
code.classList.add( 'copy-to-clipboard' );
|
code.classList.add( 'copy-to-clipboard' );
|
||||||
code.classList.add( 'pre-code' );
|
code.parentNode.classList.add( 'pre-code' );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var clone = code.cloneNode( true );
|
var clone = code.cloneNode( true );
|
||||||
|
|
Loading…
Reference in a new issue