Skip to content

Instantly share code, notes, and snippets.

@nikhilatjumpcut
Created August 5, 2019 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilatjumpcut/5dada0d5adeb80cd880865c76df7c9df to your computer and use it in GitHub Desktop.
Save nikhilatjumpcut/5dada0d5adeb80cd880865c76df7c9df to your computer and use it in GitHub Desktop.
setFBCommentOptions.js
# mutation createHtmlTag{
# createHtmlTag(data: {
# title: "FB_OPTIONS"
# isGlobal: false
# position: PREPEND_TO
# selector: "head"
# html: "<script>$(document).ready(function setFBCommentOptions() {\n $fbCommentSection = document.querySelector('.fb-comments');\n\n $fbCommentSection.setAttribute('data-order-by', 'reverse_time');\n $fbCommentSection.setAttribute('data-width', '100%');\n\n // Forcing fb comments iframe to have 100% width because facebook just won't fix\n // their own bug https: //developers.facebook.com/support/bugs/256568534516879/#_=_\n $fbCommentsWidthStyleTag = '<style>.fb-comments iframe {width: 100% !important;}</style>';\n $('head').append($fbCommentsWidthStyleTag);\n});</script>"
# }) {
# htmlTagId
# }
# }
$(document).ready(function setFBCommentOptions() {
$fbCommentSection = document.querySelector('.fb-comments');
$fbCommentSection.setAttribute('data-order-by', 'reverse_time');
$fbCommentSection.setAttribute('data-width', '100%');
// Forcing fb comments iframe to have 100% width because facebook just won't fix
// their own bug https: //developers.facebook.com/support/bugs/256568534516879/#_=_
$fbCommentsWidthStyleTag = '<style>.fb-comments iframe {width: 100% !important;}</style>';
$('head').append($fbCommentsWidthStyleTag);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment