Created
January 22, 2015 19:30
-
-
Save jde/5207ca123b8d2bd47fbb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!-- container element, a ul->li element structure will be injected into this by the nyt5 framework. Note the data-shares param that holds which share tools to bring in --> | |
<span aria-label="tools" role="group" class="share-container" data-shares="google|,facebook|,twitter|,linkedin|"></span> | |
<script> | |
// require the foundation | |
require(['foundation/main'], function () { | |
// require share-tools-container (should be in a nested require statement, not in same require as foundation) | |
require([ | |
'jquery/nyt', | |
'shared/sharetools/views/share-tools-container' | |
], function ($, ShareToolsContainer) { | |
// selecte the container | |
var $container = this.$('.share-container'), | |
shareToolsContainer; | |
// create an instance of the object | |
shareToolsContainer = new ShareToolsContainer({ | |
el: $container | |
}); | |
// set the data attributes | |
shareToolsContainer.shareData.setDescription("The Description"); | |
shareToolsContainer.shareData.setTitle("The Title"); | |
shareToolsContainer.shareData.setUrl("the Url"); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment