]> _ Git - cubist_cms-back.git/commitdiff
wait #5544 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Oct 2022 15:01:46 +0000 (17:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Oct 2022 15:01:46 +0000 (17:01 +0200)
src/resources/views/fields/code.blade.php

index 65503a999482e6aa2c9da82a86a2bbe7a6957c58..02e9356b20c3269b07382d67a3a0f808d73e0cc2 100644 (file)
@@ -52,6 +52,9 @@
                 function initMirrorCode() {
                     $('textarea.code').each(function () {
                         var textarea = $(this);
+                        if (!$(this).is(':visible')) {
+                            return;
+                        }
                         if ($(this).closest('.item.sample').length === 1) {
                             return;
                         }
                 }
 
                 initMirrorCode();
+                $(window).on("hashchange", function () {
+                    initMirrorCode();
+                });
+                $(document).on("change", "input[name='current_tab']", function () {
+                    initMirrorCode();
+                });
                 $(document).on('cubist.bunchmultiple.added', function () {
                     initMirrorCode();
                 });