summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib')
-rw-r--r--StoneIsland/www/js/lib/account/LoginView.js10
-rw-r--r--StoneIsland/www/js/lib/account/LogoutView.js6
-rw-r--r--StoneIsland/www/js/lib/nav/NavView.js8
-rw-r--r--StoneIsland/www/js/lib/nav/SearchView.js6
4 files changed, 11 insertions, 19 deletions
diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js
index 3b409b3d..31137c55 100644
--- a/StoneIsland/www/js/lib/account/LoginView.js
+++ b/StoneIsland/www/js/lib/account/LoginView.js
@@ -11,14 +11,10 @@ var LoginView = View.extend({
},
show: function(){
- this.$form.reset()
- document.body.classList.add("login")
+ this.$form.get(0).reset()
+ document.body.className = "login"
},
-
- hide: function(){
- document.body.classList.remove("login")
- },
-
+
submit: function(e){
e.preventDefault()
},
diff --git a/StoneIsland/www/js/lib/account/LogoutView.js b/StoneIsland/www/js/lib/account/LogoutView.js
index fffe661a..d5b70aff 100644
--- a/StoneIsland/www/js/lib/account/LogoutView.js
+++ b/StoneIsland/www/js/lib/account/LogoutView.js
@@ -6,11 +6,7 @@ var LogoutView = View.extend({
},
show: function(){
- document.body.classList.add("logout")
- },
-
- hide: function(){
- document.body.classList.remove("logout")
+ document.body.className = "logout"
},
submit: function(e){
diff --git a/StoneIsland/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js
index 3949c3c5..9f82bf08 100644
--- a/StoneIsland/www/js/lib/nav/NavView.js
+++ b/StoneIsland/www/js/lib/nav/NavView.js
@@ -49,7 +49,12 @@ var NavView = View.extend({
login: function(){
this.hide()
- app.router.go("login")
+ if (auth.logged_in()) {
+ this.$el.addClass("account")
+ }
+ else {
+ app.router.go("account/login")
+ }
},
search: function(){
@@ -70,6 +75,5 @@ var NavView = View.extend({
tw: function(){
window.open("https://twitter.com/stoneisland", '_system')
},
-
})
diff --git a/StoneIsland/www/js/lib/nav/SearchView.js b/StoneIsland/www/js/lib/nav/SearchView.js
index 8739f088..c9738773 100644
--- a/StoneIsland/www/js/lib/nav/SearchView.js
+++ b/StoneIsland/www/js/lib/nav/SearchView.js
@@ -6,11 +6,7 @@ var SearchView = View.extend({
},
show: function(){
- document.body.classList.add("search")
- },
-
- hide: function(){
- document.body.classList.remove("search")
+ document.body.className = "search"
},
}) \ No newline at end of file