Skip to content

Instantly share code, notes, and snippets.

@oyiptong
Created January 16, 2014 12:33
Show Gist options
  • Save oyiptong/8454274 to your computer and use it in GitHub Desktop.
Save oyiptong/8454274 to your computer and use it in GitHub Desktop.
/**
* Creates a new instance of the ribbon feed collection
*
* <p><b>Require Path:</b> shared/ribbon/instances/ribbon-data</p>
*
* @module Shared
* @submodule Shared.Ribbon
* @class RibbonDataInstance
* @static
**/
define('shared/ribbon/instances/ribbon-data',[
'jquery/nyt',
'foundation/views/page-manager',
'shared/ribbon/collections/ribbon'
], function ($, pageManager, Feed) {
'use strict';
//Create a new shared collection based on the current section
var currentArticleUrl = $('head link[rel="canonical"]').attr('href');
var sectionFeedUrl = pageManager.getMeta('article:collection');
return new Feed({
sectionFeedUrl: sectionFeedUrl,
currentArticleUrl: currentArticleUrl
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment