givanz / VvvebJs

Drag and drop page builder library written in vanilla javascript without dependencies or build tools.
https://www.vvveb.com/vvvebjs/editor.html
Apache License 2.0
6.91k stars 1.59k forks source link

where is the location of the code editor so that the html tag in the head does not return to normal after editing? #277

Closed webmestudio closed 1 year ago

webmestudio commented 1 year ago

hi sir, where is the code editor located so that the html tag in the head does not return to normal after editing?

givanz commented 1 year ago

Hi

The code editor uses Vvveb.Builder.setHtml https://github.com/givanz/VvvebJs/blob/master/libs/builder/builder.js#L1811 to update the page.

The setHtml function only updates body, it ignores <head> code because when updating <head> the browser will change the urls of <style> and <script> breaking the page.

webmestudio commented 1 year ago

where is the code that can be deactivated or removed so that the html tag in the head when edited in the code editor doesn't return to how it was before?

givanz commented 1 year ago

Hi

In the last update https://github.com/givanz/VvvebJs/commit/8a462d946f8745eaa50be2ab3c64a987f669d7bd code editor also updates <head> changes.

webmestudio commented 1 year ago

ok thank you sir work well. the problem is this will be much more effective for changes to css or js url paths and content that is installed in the head tag