mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
@@ -6,3 +6,17 @@
|
|||||||
==========
|
==========
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// rtl fixes for text-break and code blocks
|
||||||
|
/*rtl:begin:ignore*/
|
||||||
|
html[data-dir="rtl"] {
|
||||||
|
.text-break {
|
||||||
|
word-wrap: break-word!important;
|
||||||
|
word-break: break-word!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
[component="post/content"] code {
|
||||||
|
direction: ltr;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*rtl:end:ignore*/
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ define('forum/topic', [
|
|||||||
let codeBlocks = $('[component="topic"] [component="post/content"] code:not([data-button-added])');
|
let codeBlocks = $('[component="topic"] [component="post/content"] code:not([data-button-added])');
|
||||||
codeBlocks = codeBlocks.filter((i, el) => $(el).text().includes('\n'));
|
codeBlocks = codeBlocks.filter((i, el) => $(el).text().includes('\n'));
|
||||||
const container = $('<div class="hover-parent position-relative"></div>');
|
const container = $('<div class="hover-parent position-relative"></div>');
|
||||||
const buttonDiv = $('<button component="copy/code/btn" class="hover-visible position-absolute end-0 top-0 btn btn-sm btn-outline-secondary mt-2 me-4"><i class="fa fa-fw fa-copy"></i></button>');
|
const buttonDiv = $('<button component="copy/code/btn" class="hover-visible position-absolute top-0 btn btn-sm btn-outline-secondary" style="right: 0px; margin: 1rem 1rem 0 0;"><i class="fa fa-fw fa-copy"></i></button>');
|
||||||
codeBlocks.parent().wrap(container).parent().append(buttonDiv);
|
codeBlocks.parent().wrap(container).parent().append(buttonDiv);
|
||||||
codeBlocks.parent().parent().find('[component="copy/code/btn"]').translateAttr('title', '[[topic:copy-code]]');
|
codeBlocks.parent().parent().find('[component="copy/code/btn"]').translateAttr('title', '[[topic:copy-code]]');
|
||||||
codeBlocks.attr('data-button-added', 1);
|
codeBlocks.attr('data-button-added', 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user