Skip to content

Commit dc577d3

Browse files
committed
node-js: handle translated align on resize
1 parent 0c0ef14 commit dc577d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nodejs-cn/inject.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ Prism.languages.insertBefore('cpp', 'string', {
872872
Prism.highlightAll();
873873

874874
/* align blocks */
875-
!function () {
875+
(function alignBlocks() {
876876
var contentLeft, contentRight, alignLength, i, l, r, tl, tr, d,
877877
detailsLeft, detailsRight;
878878
function align() {
@@ -946,4 +946,5 @@ Prism.highlightAll();
946946
detailsRight.addEventListener('toggle', function () {
947947
detailsLeft.open = detailsRight.open;
948948
});
949-
}();
949+
window.addEventListener('resize', alignBlocks);
950+
})();

0 commit comments

Comments
 (0)