"use strict"; var filterApp; var recentNewsApp; var stickyNewsApp; var eventsApp; var countdownInterval; window.addEventListener('load', function () { filterApp = new Vue({ el: '#filterResultBox', data: { posts : [], loadListings: false, filter: [] }, methods: { pushNewData: function (newData) { this.posts.push(newData); setTimeout(function () { filterApp.loadListings = false; }, 300); } } }); /*recentNewsApp = new Vue({ el: '#stm_widget_recent_news', data: { posts : [], selectedCategory: 'all', showNews: false, showCats: false }, created: function () { this.getPosts('all'); }, methods: { getPosts: function (category) { this.selectedCategory = category; this.showCats = false; var ajaxData = document.getElementById('stm_widget_recent_news').getAttribute('data-link'); this.$http.get(stm_ajaxurl + ajaxData + '&category=' + category).then(function(response){ this.showNews = false; this.posts = response.data; setTimeout(function () { recentNewsApp.showNews = true; }, 200); }); }, showHideCategs: function() { this.showCats = (this.showCats) ? false : true; } } }); stickyNewsApp = new Vue({ el: '#features_posts_wrap', data: { posts: [], bigPost: {}, miniPosts: [], hidenPosts: [], categs: [], slugs: [], postsPerPage: 4, selectedCategory: 'all', showHiden: false, loadCategory: true }, created: function () { this.getPosts('all'); }, methods: { getPosts: function (category) { this.selectedCategory = category; var ajaxData = document.getElementById('features_posts_wrap').getAttribute('data-params'); this.$http.get(stm_ajaxurl + ajaxData + '&category=' + category).then(function(response){ this.posts = response.data; this.bigPost = {}; this.miniPosts = []; this.hidenPosts = []; this.runParsePosts(); }); }, runParsePosts: function () { this.bigPost = this.posts[0]; var hidePosition = document.getElementById('features_posts_wrap').getAttribute('data-hide-position'); this.pushCategory(this.posts[0].category, this.posts[0].cat_slug); for(var q=1;q