Skip to content

Commit

Permalink
back icon
Browse files Browse the repository at this point in the history
  • Loading branch information
nosovsh committed Oct 5, 2015
1 parent 22a8266 commit b6fea88
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 6 deletions.
4 changes: 4 additions & 0 deletions components/dump/Icon/Icon.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,7 @@
.icon-delete:before {
content: "\e810";
} /* '' */

.icon-back:before {
content: "\e811";
} /* '' */
Binary file modified components/dump/Icon/font/fontello.eot
Binary file not shown.
1 change: 1 addition & 0 deletions components/dump/Icon/font/fontello.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified components/dump/Icon/font/fontello.ttf
Binary file not shown.
Binary file modified components/dump/Icon/font/fontello.woff
Binary file not shown.
4 changes: 1 addition & 3 deletions flux/parking/ParkingStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ var ParkingStore = Fluxxor.createStore({
},

getCurrentParking: function() {
return _.find(this.parkingList, function(parking) {
return parking.id === this.currentParkingId;
}.bind(this)) || {};
return this.getParking(this.currentParkingId) || {};
},

getMyOpinionOfCurrentParking: function() {
Expand Down
16 changes: 16 additions & 0 deletions flux/user/UserActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var UserConstants = require("./UserConstants");
var UserClient = require("./UserClient");

var UserActions = {
loadUser: function(userId) {
this.dispatch(UserConstants.LOAD_USER, {});

UserClient.loadUser(userId, function(returnedUser) {
this.dispatch(UserConstants.LOAD_USER_SUCCESS, {user: returnedUser});
}.bind(this), function(error) {
this.dispatch(UserConstants.LOAD_USER_FAIL, {userId: userId, error: error});
}.bind(this));
}
};

module.exports = UserActions;
15 changes: 15 additions & 0 deletions flux/user/UserClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var $ = require("jquery");

var UserClient = {
loadUser: function(userId, success, failure) {
$.ajax({
dataType: "json",
url: "/api/users/" + userId + "/",
data: {},
success: success,
error: failure
});
}
};

module.exports = UserClient;
7 changes: 7 additions & 0 deletions flux/user/UserConstants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var UserConstants = {
LOAD_USER: "LOAD_USER",
LOAD_USER_SUCCESS: "LOAD_USER_SUCCESS",
LOAD_USER_FAIL: "LOAD_USER_FAIL"
};

module.exports = UserConstants;
28 changes: 28 additions & 0 deletions flux/user/UserStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var Fluxxor = require("fluxxor");
var UserConstants = require("./UserConstants");


var UserStore = Fluxxor.createStore({
initialize: function() {
this.users = {};

this.bindActions(
UserConstants.LOAD_USER, this.onLoadUser,
UserConstants.LOAD_USER_SUCCESS, this.onLoadUserSuccess,
UserConstants.LOAD_USER_FAIL, this.onLoadUserFail
);
},

onLoadUser: function(payload) { // eslint-disable-line no-unused-vars
},

onLoadUserSuccess: function(payload) {
this.users[payload.user.id] = _.extend({}, this.users[payload.user.id] || {}, payload.user, {fullUserLoaded: true});
this.emit("change");
},

onLoadUserFail: function(payload) { // eslint-disable-line no-unused-vars
}
});

module.exports = UserStore;
9 changes: 7 additions & 2 deletions fluxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ var AppActions = require("./flux/app/AppActions");
var ToastStore = require("./flux/toast/ToastStore");
var ToastActions = require("./flux/toast/ToastActions");

var UserStore = require("./flux/user/UserStore");
var UserActions = require("./flux/user/UserActions");


var stores = {
ParkingStore: new ParkingStore(),
Expand All @@ -30,7 +33,8 @@ var stores = {
CommentStore: new CommentStore(),
ParkingImageStore: new ParkingImageStore(),
AppStore: new AppStore(),
ToastStore: new ToastStore()
ToastStore: new ToastStore(),
UserStore: new UserStore()
};

var actions = _.extend(
Expand All @@ -40,7 +44,8 @@ var actions = _.extend(
CommentActions,
ParkingImageActions,
AppActions,
ToastActions
ToastActions,
UserActions
);

var flux = new Fluxxor.Flux(stores, actions);
Expand Down
7 changes: 6 additions & 1 deletion routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ var React = require("react");
var App = require("./components/smart/Application");
var Default = require("./components/smart/Default");
var ParkingContainer = require("./components/smart/ParkingContainer");
var UserContainer = require("./components/smart/UserContainer");
var NewParkingContainer = require("./components/smart/NewParkingContainer");
var Modal = require("./components/dump/Modal/Modal");
var SidebarContainer = require("./components/smart/SidebarContainer");

var Router = require("react-router");
var Route = Router.Route;
Expand All @@ -13,7 +15,10 @@ var IndexRoute = Router.IndexRoute;
var Routes = (
<Route path="/" component={ App } >
<IndexRoute component={ Default }/>
<Route path="/p/:id" component={ ParkingContainer }/>
<Route component={ SidebarContainer }>
<Route path="/p/:id" component={ ParkingContainer }/>
<Route path="/u/:userId" component={ UserContainer }/>
</Route>
<Route path="/add" component={ NewParkingContainer }/>
<Route path="/about" component={ Modal }/>
</Route>
Expand Down
1 change: 1 addition & 0 deletions styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ a {
right: 7px;
cursor: pointer;
font-size: 1.2em;
z-index: 200;
}

.close-wrapper:hover, .close-wrapper:active {
Expand Down

0 comments on commit b6fea88

Please sign in to comment.