Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Auto-resize canvas after FB init. #14

Closed
wants to merge 1 commit into from

1 participant

Rafael G. Dantas
Rafael G. Dantas

Adding an optional FB.Canvas.setSize() at the end of $facebook->init helper method.

Rafael G. Dantas

Oops, there's a mistake there.

Rafael G. Dantas Rafagd closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 27, 2011
  1. Rafael G. Dantas
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 views/helpers/facebook.php
9 views/helpers/facebook.php
View
@@ -393,7 +393,7 @@ function like($options = array()){
* @example $this->Facebook->init();
* @return string of scriptBlock for FB.init() or error
*/
- function init($options = null, $reload = true) {
+ function init($options = null, $reload = true, $FBCanvasSetSize = false) {
if (empty($options)) {
$options = array();
}
@@ -404,6 +404,11 @@ function init($options = null, $reload = true) {
} else {
$callback = "if(typeof(facebookReady)=='function'){facebookReady()}";
}
+
+ if ($FBCanvasSetSize) {
+ $callback = "FB.Canvas.setSize();";
+ }
+
$init = '<div id="fb-root"></div>';
$init .= $this->Html->scriptBlock(
<<<JS
@@ -449,4 +454,4 @@ private function __fbTag($tag, $label, $options){
return $retval;
}
-}
+}
Something went wrong with that request. Please try again.