Issue #2902💬 AnsweredOpened July 18, 2020by nlnbich0 reactions

Reset current frame view

快速解答by artf

You can get the canvas inner window in this way editor.Canvas.getWindow()

Read full answer below ↓

Question

Version: 0.16.12

Are you able to reproduce the bug from the demo?

[ ] Yes [x ] No

What is the expected behavior? Reset window content of current frame view

Describe the bug detailed I want to implement a component to help user do certain action by attaching event to widow (ex: scroll or resize event) or add some data to window (ex: window.pageConfig = "abc")

This component is used in different pages. But each time user switches between pages, more and more handlers get attached or component use old data from the previous page. I try to use [clear-canvas] command but it only clear dom-elements and css-rules. I try to add a new frame view to replace the current frame view, but I know sure how to do that correctly.

Could you please help to give some advice ? Thanks

Answers (1)

artfAugust 3, 2020

You can get the canvas inner window in this way editor.Canvas.getWindow()

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.