Created
December 26, 2011 12:27
-
-
Save anonymous/1521060 to your computer and use it in GitHub Desktop.
Code for omniauth fb pop-up login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# View file | |
<%= link_to image_tag("/images/facebook_connect.png"), "/auth/facebook", :class => 'login-popup' %> | |
# application.js | |
$('a.login-popup').click(function(e) { | |
var width = 600, height = 400; | |
var left = (screen.width / 2) - (width / 2); | |
var top = (screen.height / 2) - (2 * height / 3); | |
var features = 'menubar=no,toolbar=no,status=no,width=' + width + ',height=' + height + ',toolbar=no,left=' + left + ',top=' + top; | |
var loginWindow = window.open('/auth/facebook', '_blank', features); | |
loginWindow.focus(); | |
e.preventDefault(); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment