summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb_canvas.js2
-rw-r--r--fb_tab.js22
2 files changed, 17 insertions, 7 deletions
diff --git a/fb_canvas.js b/fb_canvas.js
index da22652..69222c5 100644
--- a/fb_canvas.js
+++ b/fb_canvas.js
@@ -17,7 +17,7 @@ Drupal.behaviors.fb_canvas = {
jQuery(document).bind('fb_init', FB_Canvas.setAutoResize);
}
else {
- // FB alreda initialized.
+ // FB already initialized.
FB_Canvas.setAutoResize();
}
});
diff --git a/fb_tab.js b/fb_tab.js
index d11e8f0..f28dde0 100644
--- a/fb_tab.js
+++ b/fb_tab.js
@@ -7,12 +7,22 @@
/**
* Enable canvas page specific javascript on this page.
*/
-Drupal.behaviors.fb_tab = function(context) {
- // Resize if body class includes fb_canvas-resizable.
- $('body.fb_tab-resizable:not(.fb_tab-processed)').each(function () {
- $(this).addClass('fb_tab-processed');
- jQuery(document).bind('fb_init', FB_Tab.setAutoResize);
- });
+Drupal.behaviors.fb_tab = {
+ attach: function(context, settings) {
+ // Resize if body class includes fb_canvas-resizable.
+ jQuery('body.fb_tab-resizable:not(.fb_tab-processed)').each(function () {
+ jQuery(this).addClass('fb_tab-processed');
+ if (typeof(FB) == 'undefined') {
+ // FB not yet initialized.
+ jQuery(document).bind('fb_init', FB_Tab.setAutoResize);
+ }
+ else {
+ // FB already initialized.
+ FB_Tab.setAutoResize();
+ }
+ jQuery(document).bind('fb_init', FB_Tab.setAutoResize);
+ });
+ }
};
FB_Tab = function(){};