diff options
author | Manolo Carrasco <manolo@vaadin.com> | 2014-05-09 09:47:14 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-16 12:47:40 +0000 |
commit | 3ecad007706be76bcd2183dd128259b94fdeb67a (patch) | |
tree | 94d1644506f64d64d757633586b048a31ea8d429 /WebContent/VAADIN/vaadinBootstrap.js | |
parent | 9f19979ed856e3b002eb4066e157e7e0ab24fb95 (diff) | |
download | vaadin-framework-3ecad007706be76bcd2183dd128259b94fdeb67a.tar.gz vaadin-framework-3ecad007706be76bcd2183dd128259b94fdeb67a.zip |
Avoid Vaadin entry-point being run twice (#13730)
- Prevent bootstrap script fail if registerWidgetset is called twice
with the same widgetset.
Change-Id: I8b8069b442ea91c1aa0f0b7dd73c41902e75094b
Diffstat (limited to 'WebContent/VAADIN/vaadinBootstrap.js')
-rw-r--r-- | WebContent/VAADIN/vaadinBootstrap.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index fc0fb9b948..ea1ea21b46 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -231,13 +231,16 @@ loadTheme: loadTheme, registerWidgetset: function(widgetset, callback) { log("Widgetset registered", widgetset); - widgetsets[widgetset].callback = callback; - for(var i = 0; i < widgetsets[widgetset].pendingApps.length; i++) { - var appId = widgetsets[widgetset].pendingApps[i]; - log("Starting from register widgetset", appId); - callback(appId); + var ws = widgetsets[widgetset]; + if (ws && ws.pendingApps) { + ws.callback = callback; + for(var i = 0; i < ws.pendingApps.length; i++) { + var appId = ws.pendingApps[i]; + log("Starting from register widgetset", appId); + callback(appId); + } + ws.pendingApps = null; } - widgetsets[widgetset].pendingApps = null; }, getBrowserDetailsParameters: function(parentElementId) { // Screen height and width |