Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Choose larger default and min width when action="recommend"

Summary:
Title says it all.  We're seeing some clipping of the
small button when action is set to button_count and action is
set to recomment.  90 pixels is just too short for Recommend.
This doesn't address internationalization issues at all, but
the client also has the ability to specify the width when typing
out <iframe.. or <fb:like...

Test Plan:
Loaded www.jerrycain.com/Z100.html (directed at my
sandbox) and confirmed the iframe widths were what I wanted them
to be.

DiffCamp Revision: 116910
Reviewed By: naitik
Commenters: cat
CC: cat, naitik, zhen
Revert Plan:
OK
  • Loading branch information...
commit 6866be71729f3bd5d96339382e57a7da711ce5c9 1 parent 74fee83
authored May 21, 2010

Showing 1 changed file with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. 14  src/xfbml/edge_widget.js
14  src/xfbml/edge_widget.js
@@ -131,17 +131,23 @@ FB.subclass('XFBML.EdgeWidget', 'XFBML.IframeWidget', null, {
131 131
   _getWidgetWidth : function() {
132 132
     var layout = this._getLayout();
133 133
     var should_show_faces = this._shouldShowFaces() ? 'show' : 'hide';
  134
+    var button_count_default_width =
  135
+      this.getAttribute('action') === 'recommend' ? 130 : 90;
134 136
     var layoutToDefaultWidthMap =
135  
-      { 'standard': {'show': 450, 'hide': 450},
136  
-        'bar': {'show': 700, 'hide': 450},
137  
-        'button_count': {'show': 90, 'hide': 90}};
  137
+      { 'standard': {'show': 450,
  138
+                     'hide': 450},
  139
+        'bar': {'show': 700,
  140
+                'hide': 450},
  141
+        'button_count': {'show': button_count_default_width,
  142
+                         'hide': button_count_default_width}};
138 143
     var defaultWidth = layoutToDefaultWidthMap[layout][should_show_faces];
139 144
     var width = this._getPxAttribute('width', defaultWidth)
140 145
 
141 146
     var allowedWidths =
142 147
       { 'bar' : {'min' : 600, 'max' : 900 },
143 148
         'standard' : {'min' : 225, 'max' : 900},
144  
-        'button_count' : {'min' : 90, 'max' : 900}};
  149
+        'button_count' : {'min' : button_count_default_width,
  150
+                          'max' : 900}};
145 151
     if (width < allowedWidths[layout].min) {
146 152
       width = allowedWidths[layout].min;
147 153
     } else if (width > allowedWidths[layout].max) {

0 notes on commit 6866be7

Please sign in to comment.
Something went wrong with that request. Please try again.