Created
August 5, 2019 05:21
-
-
Save nikhilatjumpcut/5dada0d5adeb80cd880865c76df7c9df to your computer and use it in GitHub Desktop.
setFBCommentOptions.js
This file contains 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
# 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