using Jquery .attr() for accessing data attributes. using .prop() here is erronious here

This commit is contained in:
Nuwan 2023-02-22 00:16:42 +05:30
parent 27d697149c
commit 1fb6907df0
2 changed files with 6 additions and 5 deletions

View File

@ -140,7 +140,7 @@
}
async function handleDeleteAudioProfile(audioProfileId) {
logger.debug("deleting audio profile: " + audioProfileId);
console.log("deleting audio profile: " + audioProfileId);
await context.jamClient.TrackDeleteProfile(audioProfileId);
@ -265,6 +265,7 @@
$root = $('#account-audio-content-scroller');
$root.on('click', 'a[data-purpose=delete-audio-profile]', async function (evt) {
evt.stopPropagation();
console.log("Delete profile", $(this))
await handleDeleteAudioProfile($(this).attr('data-id'));
return false;
});

View File

@ -277,9 +277,9 @@
for(var i = 0; i < $assignedInputs.length; i++) {
var assignedInput = $assignedInputs[i];
var $assignedInput = $(assignedInput);
var assignedChannelId = $assignedInput.data('id');
var assignedChannelId = $assignedInput.attr('data-id');
var newAssignment = Math.floor(assigned / 2) + 1;
logger.debug("re-assigning input channel %o to track: %o", assignedChannelId, newAssignment);
console.log("re-assigning input channel %o to track: %o", assignedChannelId, newAssignment);
await context.jamClient.TrackSetAssignment(assignedChannelId, true, newAssignment);
assigned += 1;
}
@ -290,8 +290,8 @@
var $assignedOutputs = $outputChannels.find('input[type="checkbox"]:checked');
for(let i = 0; i < $assignedOutputs.length; i++){
var $assignedOutput = $($assignedOutputs[i]);
var assignedChannelId = $assignedOutput.data('id');
logger.debug("re-assigning output channel %o", assignedChannelId);
var assignedChannelId = $assignedOutput.attr('data-id');
console.log("re-assigning output channel %o", assignedChannelId);
await context.jamClient.TrackSetAssignment(assignedChannelId, true, ASSIGNMENT.OUTPUT);
}
}