From 986394a80195394b49f1ff62ecc8cccaad573076 Mon Sep 17 00:00:00 2001 From: P0psicles Date: Mon, 16 Dec 2019 11:29:37 +0100 Subject: [PATCH 1/2] Fixed dragging and saving Anime / Series list handles in Home - Poster layout * Also shows notify now. --- CHANGELOG.md | 1 + themes-default/slim/src/components/home.vue | 26 +++++++++++++-------- themes-default/slim/views/home.mako | 1 + themes/dark/assets/js/medusa-runtime.js | 2 +- themes/dark/templates/home.mako | 1 + themes/light/assets/js/medusa-runtime.js | 2 +- themes/light/templates/home.mako | 1 + 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6107cb0a1b..6913b120b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ #### Fixes - Fixed season pack downloads occurring even if not needed ([#7472](https://github.com/pymedusa/Medusa/pull/7472)) - Fixed changing default indexer language and initial indexer in config-general ([#7478](https://github.com/pymedusa/Medusa/pull/7478)) +- Fixed dragging and saving Anime / Series list handles in Home - Poster layout ([#????](https://github.com/pymedusa/Medusa/pull/????)) ----- diff --git a/themes-default/slim/src/components/home.vue b/themes-default/slim/src/components/home.vue index 2c0f47738f..93525d4801 100644 --- a/themes-default/slim/src/components/home.vue +++ b/themes-default/slim/src/components/home.vue @@ -116,7 +116,7 @@ export default { }); }, mounted() { - const { config, stateLayout, setConfig } = this; + const { $snotify, config, stateLayout, setConfig } = this; // Resets the tables sorting, needed as we only use a single call for both tables in tablesorter $(document.body).on('click', '.resetsorting', () => { $('table').trigger('filterReset'); @@ -450,7 +450,7 @@ export default { } } }, - update(event) { + async update(event) { const showListOrder = $(event.target.children).map((index, el) => { return $(el).data('list'); }); @@ -460,14 +460,20 @@ export default { showListOrder: showListOrder.toArray() } }; - const section = 'layout'; - setConfig({ section, config: { layout } }) - .then(response => { - console.info(response); - }) - .catch(error => { - console.error(error); - }); + + try { + await setConfig({ section: 'main', config: { layout } }); + $snotify.success( + 'Saved Home poster list type order', + 'Saved', + { timeout: 5000 } + ); + } catch (error) { + $snotify.error( + 'Error while trying to save home poster list type order', + 'Error' + ); + } } }); }; // END initializePage() diff --git a/themes-default/slim/views/home.mako b/themes-default/slim/views/home.mako index 441969b491..6ca73eb77a 100644 --- a/themes-default/slim/views/home.mako +++ b/themes-default/slim/views/home.mako @@ -14,6 +14,7 @@