GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

Embeded Jquery events in the grapesjs editor not working as expected. #1458

Closed mrajeshkrossark closed 6 years ago

mrajeshkrossark commented 6 years ago

@artf , I tried to embed my template into the grapesjs editor. The issue am getting is the editor not working as expected with that template. Note: Am using react app for wrapping the grapesjs editor.

Initially the editor embeded my template and it is look like below image

untitled

I used Parallax effects for my template. The issue is when I click first time on the navigation bar, it reacts differently and load one more editor iniside the existing editor.

untitled

The error is: Uncaught TypeError: Cannot read property '_cash1537883139698' of undefined -- grapesjs:6506

the below javascript code using inside the editor:

<script type="text/javascript"> 
        $(document).ready(function () {
            /*
            * Plugin intialization
            */
            $('#pagepiling').pagepiling({
                menu: '#menu',
                anchors: ['VP', 'about', 'insurances-accepted', 'specialties', 'patient-reviews', 'contact'],
                sectionsColor: ['#fff', '#fff', '#fff', '#fff', '#fff', '#fff'],
                navigation: {
                    'position': 'left',                 
                },
                afterRender: function () {

                    $('#pp-nav').addClass('custom');
                },
                afterLoad: function (anchorLink, index) {
                    $("#title").text(anchorLink);
                    if (index > 1) {
                        $('#pp-nav').removeClass('custom');
                    } else {
                        $('#pp-nav').addClass('custom');
                    }
                },
            });
            $('#toggle').click(function () {
            $(this).toggleClass('active');
            $('#overlay').toggleClass('open');
            });
        });

    </script>
artf commented 6 years ago

Please a create a live demo of the issue

no-response[bot] commented 6 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.