kirby-tools / community

Report bugs and engage in the future of the plugins
0 stars 0 forks source link

Add delay and enable/disable auto-refresh via blueprint #10

Closed squareclouds closed 6 months ago

squareclouds commented 6 months ago

Describe the feature

it would be nice to be able to set a delay in the blueprint. if the user keeps typing and the delay-time was not reached, the refresh event keeps getting reset. otherwise, in pages with some animations, this creates a lot of distraction for the user. or maybe even a param to disable auto refresh so the user uses the refresh-button, and adding a keyboard shortcut for the refresh button as well

Final checks

johannschopplich commented 6 months ago

You can disable the animations in JS:

const isPreviewMode = document.documentElement.dataset.previewMode;

if (!isPreviewMode) {
  // Init your cookie banner
}

But I still think manually refreshing is a good feature idea. Will implement that.

johannschopplich commented 6 months ago

I have also added a new feature if the animation management is not enough.

With v1.2.0, a new updateInterval section option allows you to set the frequency at which the preview is updated. By default, the preview is updated every 250 milliseconds (0.25 seconds). You can adjust the update interval to a custom value in milliseconds or disable it altogether with false.