mirror of
https://github.com/craigerl/aprsd.git
synced 2025-04-09 13:08:32 -04:00
webchat: got active tab onclick working
This patch adds the ability to click on the already existing active tab and have it populate the to_call input box.
This commit is contained in:
parent
8a90d5480a
commit
1400e3e711
@ -172,7 +172,7 @@ function create_callsign_tab(callsign, active=false) {
|
||||
}
|
||||
|
||||
item_html = '<li class="nav-item" role="presentation">';
|
||||
item_html += '<button callsign="'+callsign+'" class="nav-link '+active_str+'" id="'+tab_id+'" data-bs-toggle="tab" data-bs-target="#'+tab_content+'" type="button" role="tab" aria-controls="'+callsign+'" aria-selected="true">';
|
||||
item_html += '<button onClick="$(\'#to_call\').val(\''+callsign+'\');" callsign="'+callsign+'" class="nav-link '+active_str+'" id="'+tab_id+'" data-bs-toggle="tab" data-bs-target="#'+tab_content+'" type="button" role="tab" aria-controls="'+callsign+'" aria-selected="true">';
|
||||
item_html += callsign+' ';
|
||||
item_html += '<span onclick="delete_tab(\''+callsign+'\');">×</span>';
|
||||
item_html += '</button></li>'
|
||||
|
@ -48,16 +48,16 @@
|
||||
console.log('Wipe local storage');
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
// When a tab is clicked, populate the to_call form field.
|
||||
$(document).on('shown.bs.tab', 'button[data-bs-toggle="tab"]', function (e) {
|
||||
var tab = $(e.target);
|
||||
var callsign = tab.attr("callsign");
|
||||
var to_call = $('#to_call');
|
||||
to_call.val(callsign);
|
||||
});
|
||||
});
|
||||
|
||||
// When a tab is clicked, populate the to_call form field.
|
||||
$(document).on('shown.bs.tab', 'button[data-bs-toggle="tab"]', function (e) {
|
||||
var tab = $(e.target);
|
||||
var callsign = tab.attr("callsign");
|
||||
var to_call = $('#to_call');
|
||||
console.log("Tab clicked on " + callsign);
|
||||
to_call.val(callsign);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user