Permalink
Browse files

JS component of the fb:login-button with iframe + perms fix.

Summary:
see http://tools.intern.facebook.com/D121897.

Test Plan:
see http://tools.intern.facebook.com/D121897

DiffCamp Revision: 121898
Reviewed By: jcain
CC: ahaugen, jcain, brent
Tasks:
#213799: login-button w/ faces (perms)

Revert Plan:
OK
  • Loading branch information...
1 parent 018e4c1 commit 0b2cd6326fcddb6f120115edcc50834756fee2f2 yariv committed Jun 9, 2010
Showing with 17 additions and 9 deletions.
  1. +11 −8 src/xfbml/tags/facepile.js
  2. +6 −1 src/xfbml/xfbml.js
View
@@ -27,7 +27,7 @@
*/
FB.subclass('XFBML.Facepile', 'XFBML.IframeWidget', null, {
_visibleAfter: 'load',
- _showFaces: true,
+ _extraParams: {},
/**
* Do initial attribute processing.
@@ -36,21 +36,24 @@ FB.subclass('XFBML.Facepile', 'XFBML.IframeWidget', null, {
this._attr = {
channel: this.getChannelUrl(),
max_rows: this.getAttribute('max-rows'),
- width: this._getPxAttribute('width', 200),
- show_faces: this._showFaces
- };
+ width: this._getPxAttribute('width', 200)
+ };
+
+ for (var key in this._extraParams) {
+ this._attr[key] = this._extraParams[key];
+ }
return true;
},
/**
- * Set the value of one of the parameters that will be passed
- * to the url widget's url.
+ * Sets extra parameters that will be passed to the widget's url.
*/
- setShowFaces: function(val) {
- this._showFaces = val;
+ setExtraParams: function(val) {
+ this._extraParams = val;
},
+
/**
* Setup event handlers.
*/
View
@@ -185,7 +185,12 @@ FB.provide('XFBML', {
element = dom._element = new fn(dom);
if (isLogin) {
- element.setShowFaces(showFaces);
+ var extraParams = {show_faces: showFaces};
+ var perms = dom.getAttribute('perms');
+ if (perms) {
+ extraParams['perms'] = perms;
+ }
+ element.setExtraParams(extraParams);
}
element.subscribe('render', cb);

0 comments on commit 0b2cd63

Please sign in to comment.