fixed missing ifmounted bug / fixed getting item when navigating directly to page
This commit is contained in:
@@ -8,6 +8,17 @@ var _ = require('underscore');
|
||||
// Extend ItemStore with EventEmitter to add eventing capabilities
|
||||
var NavigationStore = _.extend({}, EventEmitter.prototype, {
|
||||
|
||||
getItemIdFromUrl: function () {
|
||||
// ugly but it seems to me that
|
||||
// router does not want to expose its
|
||||
// state
|
||||
var url = document.URL;
|
||||
var itemIdRegex = /artikal\/(\d+)\//;
|
||||
var match = itemIdRegex.exec(url);
|
||||
console.log(match);
|
||||
return match[0];
|
||||
},
|
||||
|
||||
// Emit Change event
|
||||
emitChange: function() {
|
||||
console.log("NavigationStore change!");
|
||||
|
||||
Reference in New Issue
Block a user