mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-01 14:20:10 +01:00
fix ajax call url on profile pages
This commit is contained in:
parent
c324d560b3
commit
31375fab61
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class SdrFormController(SettingsFormController, metaclass=ABCMeta):
|
|||
def render_tabs(self):
|
||||
return """
|
||||
<ul class="nav nav-tabs profile-tabs">
|
||||
<li class="nav-item">
|
||||
<li class="nav-item device">
|
||||
<a class="nav-link {device_active}" href="{device_link}">{device_name}</a>
|
||||
</li>
|
||||
{profile_tabs}
|
||||
|
|
|
|||
Loading…
Reference in a new issue