Permalink
Browse files

Fix DOM ready race condition in Alert Widget

When packaged the framework and the alert script can load before the DOM
is ready to be manipulated. Need to wait for DOM ready to show the
alert.
  • Loading branch information...
kabel committed Jul 10, 2015
1 parent 9f924b1 commit 9bb042f0869eb91f07bea81e0b33ed226f71c809
Showing with 3 additions and 1 deletion.
  1. +3 −1 wdn/templates_4.0/scripts/unlalert.js
@@ -226,7 +226,9 @@ define(['jquery', 'wdn'], function($, WDN) {
// There is an alert if unlAlerts.data.alert.info exists
if (unlAlerts.data.alert && unlAlerts.data.alert.info) {
WDN.log("Found an alert");
- alertUser(unlAlerts.data.alert);
+ $(function() {
+ alertUser(unlAlerts.data.alert);
+ });
} else {
noAlert();
}

0 comments on commit 9bb042f

Please sign in to comment.