sidebar design implemented on search by category and by section page
This commit is contained in:
@@ -12,16 +12,16 @@ var sectionState = {
|
||||
};
|
||||
|
||||
|
||||
var loadSections = function() {
|
||||
var loadSections = function() {
|
||||
var sections = new SectionCollection();
|
||||
sections.fetch({success: function() {
|
||||
sectionState.sections = sections.models;
|
||||
// change will be called automatically when
|
||||
// action is run but we need to emit it again
|
||||
// when the data arive
|
||||
// when the data arive
|
||||
// it's a bit "unfluxy" but convenient.
|
||||
// "true philosophy" would be to run another "data arrived" action
|
||||
SectionStore.emitChange();
|
||||
SectionStore.emitChange();
|
||||
}});
|
||||
};
|
||||
|
||||
@@ -30,6 +30,7 @@ var loadSectionDetails = function(sectionId) {
|
||||
section.fetch({
|
||||
success: function() {
|
||||
_sectionDetails = section;
|
||||
console.log('section details', _sectionDetails);
|
||||
SectionStore.emitChange();
|
||||
}
|
||||
});
|
||||
@@ -43,7 +44,7 @@ var setHovered = function(id) {
|
||||
// Extend SectionStore with EventEmitter to add eventing capabilities
|
||||
var SectionStore = _.extend({}, EventEmitter.prototype, {
|
||||
|
||||
// Return Single Item With Details
|
||||
// Return Single Item With Details
|
||||
getState: function() {
|
||||
return sectionState;
|
||||
},
|
||||
@@ -77,7 +78,7 @@ AppDispatcher.register(function(payload) {
|
||||
|
||||
// Respond to SELECT_ITEM action
|
||||
case SectionConstants.LOAD_SECTIONS:
|
||||
loadSections();
|
||||
loadSections();
|
||||
break;
|
||||
|
||||
case SectionConstants.SET_SECTION_HOVER:
|
||||
|
||||
Reference in New Issue
Block a user