diff --git a/src/admin/js/main.js b/src/admin/js/main.js index f0d8ca29f..7a82fd3b8 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -37,13 +37,14 @@ router.beforeEach((to, from, next) => { document.title = to.meta.title next() }); -Vue.use(Buefy); +Vue.use(Buefy); Vue.use(I18NPlugin); Vue.use(UserPrefsPlugin); Vue.use(RouterHelperPlugin); Vue.use(ConsolePlugin, {visual: false}); // Register Components +/* Fields */ Vue.component('tainacan-text', Text); Vue.component('tainacan-textarea', Textarea); Vue.component('tainacan-selectbox', Selectbox); @@ -55,20 +56,18 @@ Vue.component('tainacan-category', Category); Vue.component('tainacan-form-relationship', FormRelationship); Vue.component('tainacan-form-category', FormCategory); Vue.component('tainacan-form-selectbox', FormSelectbox); - Vue.component('tainacan-form-item', TaincanFormItem); Vue.component('tainacan-filters-list', TaincanFiltersList); -Vue.component('help-button', HelpButton); -Vue.component('draggable', draggable); - /* Filters */ - Vue.component('tainacan-filter-custom-interval', FilterCustomInterval); Vue.component('tainacan-filter-selectbox', FilterSelectbox); Vue.component('tainacan-filter-autocomplete', FilterAutocomplete); Vue.component('tainacan-filter-checkbox', FilterCheckbox); Vue.component('tainacan-filter-taginput', FilterTaginput); +/* Others */ +Vue.component('help-button', HelpButton); +Vue.component('draggable', draggable); new Vue({ el: '#tainacan-admin-app', diff --git a/src/admin/js/utilities.js b/src/admin/js/utilities.js index 6f5ccef13..4eafa67e4 100644 --- a/src/admin/js/utilities.js +++ b/src/admin/js/utilities.js @@ -7,19 +7,19 @@ const wpApi = axios.create({ wpApi.defaults.headers.common['X-WP-Nonce'] = tainacan_plugin.nonce; -// I18N PLUGIN - Allows access to Wordpress translation file. +// CONSOLE PLUGIN - Allows custom use of console functions and avoids eslint warnings. export const ConsolePlugin = {}; ConsolePlugin.install = function (Vue, options = { visual: false }) { - + Vue.prototype.$console = { log(something) { if (options.visual) { - this.$snackbar.open({ + Vue.prototype.$snackbar.open({ message: something, type: 'is-secondary', position: 'is-bottom-right', indefinite: true, - queue: true + queue: false }); } else { console.log(something); @@ -27,12 +27,12 @@ ConsolePlugin.install = function (Vue, options = { visual: false }) { }, info(someInfo) { if (options.visual) { - this.$snackbar.open({ + Vue.prototype.$snackbar.open({ message: someInfo, type: 'is-primary', position: 'is-bottom-right', duration: 5000, - queue: true + queue: false }); } else { console.info(someInfo); @@ -40,12 +40,12 @@ ConsolePlugin.install = function (Vue, options = { visual: false }) { }, error(someError) { if (options.visual) { - this.$snackbar.open({ + Vue.prototype.$snackbar.open({ message: someError, type: 'is-danger', position: 'is-bottom-right', indefinite: true, - queue: true + queue: false }); } else { console.error(someError); diff --git a/src/admin/scss/tainacan-admin.scss b/src/admin/scss/tainacan-admin.scss index 78adada7a..b194d28fe 100644 --- a/src/admin/scss/tainacan-admin.scss +++ b/src/admin/scss/tainacan-admin.scss @@ -70,9 +70,9 @@ html { } } -// Buefy notices (toast) +// Buefy notices (toast, snackbar...) .notices { - z-index: 99999999 !important; + z-index: 99999999999999 !important; } // Input components used in forms are gray in Tainacan