* Create DOM element for the Facebook embedded page plugin. * Reference: https://developers.facebook.com/docs/plugins/page-plugin * @param {!Window} global * @param {!Object} data The element data * @return {!Element} div
(global, data)
| 106 | * @return {!Element} div |
| 107 | */ |
| 108 | function getPageContainer(global, data) { |
| 109 | const container = createContainer(global, 'page', data.href); |
| 110 | container.setAttribute('data-tabs', data.tabs); |
| 111 | container.setAttribute('data-hide-cover', data.hideCover); |
| 112 | container.setAttribute('data-show-facepile', data.showFacepile); |
| 113 | container.setAttribute('data-hide-cta', data.hideCta); |
| 114 | container.setAttribute('data-small-header', data.smallHeader); |
| 115 | container.setAttribute('data-adapt-container-width', true); |
| 116 | |
| 117 | const c = global.document.getElementById('c'); |
| 118 | // Note: The facebook embed allows a maximum width of 500px. |
| 119 | // If the container's width exceeds that, the embed's width will |
| 120 | // be clipped to 500px. |
| 121 | container.setAttribute('data-width', c./*OK*/ offsetWidth); |
| 122 | return container; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Create DOM element for the Facebook comments plugin: |
no test coverage detected