groups of articles now shown on ribica.ba/group/1/, background is in cloudinary

This commit is contained in:
Senad Uka
2015-03-23 07:21:53 +01:00
parent 0ff47313df
commit b534d15866
13 changed files with 143 additions and 5 deletions

View File

@@ -5,10 +5,24 @@ var NavigationConstants = require('../constants/navigationConstants')
var _ = require('underscore');
var getGroupIdFromUrl = function() {
console.log("yeee" , match);
// ugly but it seems to me that
// router does not want to expose its
// state (for phylosophical reasons)
var url = document.URL;
var itemIdRegex = /grupa\/(\d+)\//g;
var match = itemIdRegex.exec(url);
console.log(match);
return match[1];
};
// Extend ItemStore with EventEmitter to add eventing capabilities
var NavigationStore = _.extend({}, EventEmitter.prototype, {
getGroupIdFromUrl: getGroupIdFromUrl,
// Emit Change event
emitChange: function() {
@@ -29,6 +43,8 @@ var NavigationStore = _.extend({}, EventEmitter.prototype, {
});
// Register callback with AppDispatcher
NavigationStore.dispatchToken = AppDispatcher.register(function(payload) {
var action = payload.action;