Fix Scroll

This commit is contained in:
Kekskurse 2019-09-24 16:46:02 +02:00
parent 6ea03eeacb
commit 21fb038128
5 changed files with 18 additions and 8 deletions

View file

@ -1 +1 @@
VUE_APP_API_URL=http://localhost:8000/ VUE_APP_API_URL=http://localhost:8000

View file

@ -12,6 +12,9 @@
</div> </div>
<div v-if="!$store.getters.getAllDataLoaded"> <div v-if="!$store.getters.getAllDataLoaded">
Loading ... Loading ...
<div v-if="$store.getters.getError">
Es gab einen Fehler, bitte probiere es später nochmal
</div>
</div> </div>
</v-app> </v-app>
</template> </template>

View file

@ -181,6 +181,7 @@
} }
}, },
handleScroll: function (evt, el) { handleScroll: function (evt, el) {
console.log(el);
console.log("SCROLL: "+evt.pageY); console.log("SCROLL: "+evt.pageY);
if(evt.pageY > 100) { if(evt.pageY > 100) {
this.big = false; this.big = false;

View file

@ -122,8 +122,8 @@
}, },
methods: { methods: {
handleScroll: function (evt, el) { handleScroll: function (evt, el) {
console.log("SCROLL: "+evt.pageY); let scrollPos = document.documentElement.scrollTop;
if(evt.pageY > 0) { if(scrollPos> 0) {
this.big = false; this.big = false;
this.bgcolor = "#fff"; this.bgcolor = "#fff";
this.flat = false; this.flat = false;

View file

@ -13,7 +13,8 @@ export default new Vuex.Store({
me: [], me: [],
redirectIfLoggedIn: null, redirectIfLoggedIn: null,
settings: [], // The TV inventory settings: [], // The TV inventory
sideMenu: false, //Toggle Side Menu on side Bar sideMenu: false, //Toggle Side Menu on side Bar,
error: false
}, },
getters: { getters: {
@ -38,6 +39,9 @@ export default new Vuex.Store({
} }
return loaded; return loaded;
}, },
getError: (state) => {
return state.error
},
getMe: (state) => { getMe: (state) => {
return state.me; return state.me;
} }
@ -48,6 +52,9 @@ export default new Vuex.Store({
state.settings = settings; state.settings = settings;
state.settingsLoaded = true; state.settingsLoaded = true;
}, },
setError: function(state) {
state.error = true;
},
setMe: function(state, me) { setMe: function(state, me) {
if(me == false) { if(me == false) {
state.loggedIn = false; state.loggedIn = false;
@ -67,6 +74,8 @@ export default new Vuex.Store({
ServerService.getPublicSettings().then((res) => { ServerService.getPublicSettings().then((res) => {
context.commit('setSettings', res.data.data) context.commit('setSettings', res.data.data)
resolve() resolve()
}).catch((res) => {
context.commit('setError')
}); });
}) })
}, },
@ -74,14 +83,11 @@ export default new Vuex.Store({
UserService.getTokenFromStorage(); UserService.getTokenFromStorage();
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
UserService.me().then((res) => { UserService.me().then((res) => {
console.log("GET USER DATA");
context.commit('setMe', res.data.data) context.commit('setMe', res.data.data)
}, (res) => { }, (res) => {
context.commit('setMe', false) context.commit('setMe', false)
console.log("DONT GET USER DATA");
console.log(res.response.data)
}) })
}) })
} }
} }
}); });