Don't call the editCalendarCallback until the RedBox has finished displaying.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 10 Mar 2010 06:27:32 +0000 (01:27 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 10 Mar 2010 06:29:34 +0000 (01:29 -0500)
This fixes issues during the first load of the calendar chunk:
  Proper enabling/disabling the form based on perms
  Properly initializing the pretty autocompleter

kronolith/js/kronolith.js

index c0f6a7a..fce980f 100644 (file)
@@ -2130,8 +2130,8 @@ KronolithCore = {
             RedBox.loading();
             this.doAction('chunkContent', { chunk: 'calendar' }, function(r) {
                 if (r.response.chunk) {
+                    RedBox.onDisplay = function() { this.editCalendarCallback(calendar); RedBox.onDisplay = null; }.bind(this);
                     RedBox.showHtml(r.response.chunk);
-                    this.editCalendarCallback(calendar);
                 } else {
                     this.closeRedBox();
                 }