Kaynağa Gözat

set doc/win

master
Odilitime 3 yıl önce
ebeveyn
işleme
9384083231
  1. 6
      src/interfaces/elements/SCRIPTElement.cpp

6
src/interfaces/elements/SCRIPTElement.cpp

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
#include "../../tools/WebResource.h"
#include "../../tools/Log.h"
#include "../../parsers/scripting/javascript/JSParser.h"
#include "../../parsers/scripting/javascript/BrowserJS.h"
#include "../../app/app.h"
#include <ctime>
@ -51,7 +52,10 @@ std::unique_ptr<Component> SCRIPTElement::renderer(const ElementRenderRequest &r @@ -51,7 +52,10 @@ std::unique_ptr<Component> SCRIPTElement::renderer(const ElementRenderRequest &r
}
// parse JS
//std::cout << "SCRIPTElement::renderer - source: " << source << std::endl;
std::shared_ptr<JavaScript> newScript = std::make_shared<JavaScript>();
std::shared_ptr<BrowserJavaScript> newScript = std::make_shared<BrowserJavaScript>();
// set it up as a browser js
newScript->document = request.docComponent;
newScript->window = newScript->document->win.get();
// import current state (scope)
newScript->applyScope(request.docComponent->mainScript);
// parse it

Yükleniyor…
İptal
Kaydet