<template>
  <v-app>
    <NavBar />
    <v-main>
      <Nuxt />
    </v-main>
    <Footer />
    <customNotifications></customNotifications>
    <customMessenger></customMessenger>
  </v-app>
</template>

<script>
import NavBar from "../components/NavBar.vue";
import Footer from "../components/Footer.vue";
import customNotifications from "@/components/newComponent/notifications/notifications.vue";
import customMessenger from "@/components/fb-messenger/customMessenger.vue";
export default {
  name: "DefaultLayout",
  components: {
    Footer,
    NavBar,
    customNotifications,
    customMessenger,
  },
  data() {
    return {};
  },
  computed: {
    drawerAcitve() {
      return this.$store.getters.getDrawerStatus;
    },
    searchDialogActive() {
      return this.$store.getters.getSearchDialogStatus;
    }
  },
  watch: {
    drawerAcitve: {
      handler: function () {
        this.bsd(this.drawerAcitve);
      }
    },
    searchDialogActive: {
      handler: function () {
        this.bsd(this.searchDialogActive);
      }
    }
  },
  methods: {
    bsd(status) {
      var body = document.querySelector("body");
      var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
      var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
      window.onscroll = function () { };
      if (status === true) {
        if (window.onscroll !== null) {
          window.onscroll = function () {
            window.scrollTo(scrollLeft, scrollTop);
          };
        }
      } else {
        window.onscroll = function () { };
      }
    }
  }
};
</script>

<style lang="scss" scoped>

</style>
