diff --git a/components/PostContent.vue b/components/PostContent.vue index eb0ad64d..b6b8485e 100644 --- a/components/PostContent.vue +++ b/components/PostContent.vue @@ -1,60 +1,107 @@ + + \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue index 447512fd..98169f3f 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -3,6 +3,7 @@ + diff --git a/nuxt.config.js b/nuxt.config.js index 648dd75b..e3713453 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -129,7 +129,8 @@ export default { ** Plugins to load before mounting the App */ plugins: [ - { src: '~plugins/goatcounter.js', mode: 'client' } + { src: '~plugins/goatcounter.js', mode: 'client' }, + { src: '~plugins/closest-polyfill.js', mode: 'client' } ], /* ** Nuxt.js dev-modules @@ -145,7 +146,8 @@ export default { modules: [ '@nuxtjs/pwa', // Doc: https://github.com/nuxt-community/dotenv-module - '@nuxtjs/dotenv' + '@nuxtjs/dotenv', + 'portal-vue/nuxt' ], /* ** Build configuration diff --git a/package.json b/package.json index 2ddd3ad2..0f453e2b 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "fetch-ponyfill": "^7.0.0", "he": "^1.2.0", "nuxt": "^2.0.0", + "portal-vue": "^2.1.7", "sitemap-webpack-plugin": "^1.0.0", "wpapi": "^1.2.1" }, diff --git a/plugins/closest-polyfill.js b/plugins/closest-polyfill.js new file mode 100644 index 00000000..996ab323 --- /dev/null +++ b/plugins/closest-polyfill.js @@ -0,0 +1,21 @@ +export default () => { + if (!Element.prototype.matches) { + Element.prototype.matches = + Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + } + + if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + var el = this; + + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } + + +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 95499dde..61ff3b79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8297,6 +8297,11 @@ pn@^1.1.0: resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +portal-vue@^2.1.7: + version "2.1.7" + resolved "https://registry.yarnpkg.com/portal-vue/-/portal-vue-2.1.7.tgz#ea08069b25b640ca08a5b86f67c612f15f4e4ad4" + integrity sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"