Skip to content

Commit

Permalink
Better Buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
barisatay0 committed Jul 9, 2024
1 parent 89744e6 commit a732791
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions resources/views/manager.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,28 @@ function updateModels() {
});
function addSidebarButton(modelid, name) {
var buttonHtml = '<button type="button" class="btn bg-dark text-white text-capitalize mx-1 mb-2" id="' +
modelid +
'">' + name + '</button>';
$('#addedButtons').append(buttonHtml);
}
var buttonHtml = '<button type="button" class="btn bg-dark text-white text-capitalize mx-1 mb-2" id="' +
modelid +
'">' + name + '</button>';
$('#addedButtons').append(buttonHtml);
$('#addedButtons').on('click', '#' + modelid, function() {
var checkbox = $('[data-id="' + modelid + '"] .myCheckbox');
if (checkbox.length > 0) {
checkbox.prop('checked', false);
toggleSelection(modelid);
}
$(this).remove();
});
$('[data-id="' + modelid + '"] .myCheckbox').change(function() {
toggleSelection(modelid);
});
}
// Local Storage For Stability
function checkCacheAndUpdateModels() {
var cachedModels = localStorage.getItem('cachedModels');
Expand Down

0 comments on commit a732791

Please sign in to comment.