From 31375fab61a241a2a6d0a17e72d0b26f8bd1408c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 18 May 2023 21:12:13 +0200 Subject: [PATCH] fix ajax call url on profile pages --- htdocs/lib/settings/ProfileList.js | 18 ++++++++++-------- owrx/controllers/settings/sdr.py | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/lib/settings/ProfileList.js b/htdocs/lib/settings/ProfileList.js index dcf9df9d..e215dbbf 100644 --- a/htdocs/lib/settings/ProfileList.js +++ b/htdocs/lib/settings/ProfileList.js @@ -11,14 +11,6 @@ $.fn.profileList = function() { return !!$target.length; } - var moveProfile = function(profileId, index) { - return $.ajax(document.location.href + '/moveprofile', { - data: JSON.stringify({profile_id: profileId, index: index}), - contentType: 'application/json', - method: 'POST' - }); - } - this.each(function () { var $profileList = $(this); var $profiles = $profileList.find('.profile'); @@ -26,6 +18,16 @@ $.fn.profileList = function() { $profiles.find('a').attr('draggable', 'false'); var $profileEl; var originalIndex; + + var moveProfile = function(profileId, index) { + var url = $profileList.find('.device a').attr('href'); + return $.ajax(url + '/moveprofile', { + data: JSON.stringify({profile_id: profileId, index: index}), + contentType: 'application/json', + method: 'POST' + }); + } + $profileList.on('dragstart', '.profile', function(event){ $profileEl = $(event.originalEvent.target); originalIndex = $profileEl.index(); diff --git a/owrx/controllers/settings/sdr.py b/owrx/controllers/settings/sdr.py index 9440465c..110b2fa0 100644 --- a/owrx/controllers/settings/sdr.py +++ b/owrx/controllers/settings/sdr.py @@ -130,7 +130,7 @@ class SdrFormController(SettingsFormController, metaclass=ABCMeta): def render_tabs(self): return """