diff --git a/src/assets/index.html b/src/assets/index.html index 822304f..3e14ea5 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -35,7 +35,7 @@ {% inline "assorted.svg" %}
- + @@ -260,8 +260,8 @@
- -
@@ -423,7 +423,7 @@
- + diff --git a/src/assets/javascripts/app.js b/src/assets/javascripts/app.js index d6ac12c..c23749a 100644 --- a/src/assets/javascripts/app.js +++ b/src/assets/javascripts/app.js @@ -136,6 +136,43 @@ Vue.component('dropdown', { }, }) +Vue.component('modal', { + props: ['open'], + template: ` + + `, + data: function() { + return {opening: false} + }, + watch: { + 'open': function(newVal) { + if (newVal) { + this.opening = true + document.addEventListener('click', this.handleClick) + } else { + document.removeEventListener('click', this.handleClick) + } + }, + }, + methods: { + handleClick: function(e) { + if (this.opening) { + this.opening = false + return + } + if (e.target.closest('.modal-content') == null) this.$emit('hide') + }, + }, +}) + function dateRepr(d) { var sec = (new Date().getTime() - d.getTime()) / 1000 var neg = sec < 0 @@ -181,14 +218,6 @@ var vm = new Vue({ this.refreshFeeds() this.refreshStats() }, - mounted: function() { - this.$root.$on('bv::modal::hidden', function(bvEvent, modalId) { - if (vm.settings == 'create') { - vm.feedNewChoice = [] - vm.feedNewChoiceSelected = '' - } - }) - }, data: function() { return { 'filterSelected': undefined, @@ -214,7 +243,7 @@ var vm = new Vue({ 'filteredFolderStats': {}, 'filteredTotalStats': null, - 'settings': 'create', + 'settings': '', 'loading': { 'feeds': 0, 'newfeed': false, @@ -525,7 +554,7 @@ var vm = new Vue({ if (result.status === 'success') { vm.refreshFeeds() vm.refreshStats() - vm.$bvModal.hide('settings-modal') + vm.settings = '' } else if (result.status === 'multiple') { vm.feedNewChoice = result.choice vm.feedNewChoiceSelected = result.choice[0].url @@ -597,8 +626,11 @@ var vm = new Vue({ }, showSettings: function(settings) { this.settings = settings - this.$bvModal.show('settings-modal') + if (settings === 'create') { + vm.feedNewChoice = [] + vm.feedNewChoiceSelected = '' + } if (settings === 'manage') { api.feeds.list_errors().then(function(errors) { vm.feed_errors = errors diff --git a/src/assets/stylesheets/app.css b/src/assets/stylesheets/app.css index 5e858cf..5da45c4 100644 --- a/src/assets/stylesheets/app.css +++ b/src/assets/stylesheets/app.css @@ -84,10 +84,6 @@ select.form-control:not([multiple]):not([size]) { outline: none; } -.modal-backdrop { - background-color: rgba(0, 0, 0, 0.7); -} - .modal.fade .modal-dialog { transition: none !important; transform: none !important; @@ -384,6 +380,12 @@ select.form-control:not([multiple]):not([size]) { left: -999px; } +.custom-modal { + background-color: rgba(0, 0, 0, 0.9); + overflow-y: auto; + display: block !important; +} + /* content */ .content {