Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

FB.Canvas.setSize #3

Open
ibes opened this issue Jan 10, 2012 · 4 comments
Open

FB.Canvas.setSize #3

ibes opened this issue Jan 10, 2012 · 4 comments

Comments

@ibes
Copy link

ibes commented Jan 10, 2012

Hi,

any plans to include a ready to include (link) .js-file wo easily get this to work:
https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/

You need to load the JS SDK and then it is simple.
Would be nice to have one maintained file to just script-link in an get a auto sized canvas/tab.

Here like I use it with asynchronous load of the JS SDK:

window.fbAsyncInit = function() {
FB.Canvas.setSize();
};

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());

@ckrack
Copy link
Owner

ckrack commented Jan 10, 2012

yep, it's planned to do that!
https://github.com/ckrack/fbootstrapp/blob/master/TODO.md

@tobsn
Copy link

tobsn commented Jan 12, 2012

there should be a default example set of functions to get this going - is there a dev branch to see changes? i wouldnt mind pushing some examples ;)

@ckrack
Copy link
Owner

ckrack commented Jan 12, 2012

Yeah i agree.
The dev branch is here:
https://github.com/ckrack/fbootstrapp/tree/development

It's currently on the same status as the master branch.

If you want to push that'd be great.
The examples are the examples/fb-* files.
These are supposed to be the starting point.

I'd prefer to have the javascript code seperate in js/application.js

@262media
Copy link

If using FB.Canvas.setAutoGrow(); with a page with more than the regular 800px the modals fired from fbootstrap get misplaced (sometimes not visible in the screen area but placed in the center of the iframe).
any thoughts about how to solve this?

Probably not the best coding but I've implemented this to solve my own question:

function scrollTo(y){
FB.Canvas.getPageInfo(function(pageInfo){
$({y: pageInfo.scrollTop}).animate(
{y: y},
{duration: 1000, step: function(offset){
FB.Canvas.scrollTo(0, offset);
}
});
});
}

//usage:
$('.modal').bind('shown', function () {
var isto = $(this).offset();

var quanto = isto.top;

scrollTo(quanto);

})

//but i'm open to other sugestions
//P.S.:sorry for my bad english

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants