Skip to content

Commit

Permalink
refactor: remove unneeded js
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Jul 20, 2024
1 parent ad1a379 commit c0accf4
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions resources/views/browse/_masterlist_js.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,49 +43,5 @@ function setView(status) {
window.localStorage.setItem('lorekeeper_masterlist_view', 'list');
}
}
var $featureBody = $('#featureBody');
var $featureSelect = $('#featureContent .feature-block');
var $addFeatureButton = $('.add-feature-button');
// handle the ones that were already there
var $existingFeatures = $('#featureBody .feature-block');
@if (config('lorekeeper.extensions.organised_traits_dropdown'))
$existingFeatures.find('.selectize').selectize({
render: {
item: featureSelectedRender
}
});
@else
$existingFeatures.find('.selectize').selectize();
@endif
addRemoveListener($existingFeatures);
$addFeatureButton.on('click', function(e) {
e.preventDefault();
var $clone = $featureSelect.clone();
$featureBody.append($clone);
@if (config('lorekeeper.extensions.organised_traits_dropdown'))
$clone.find('.selectize').selectize({
render: {
item: featureSelectedRender
}
});
@else
$clone.find('.selectize').selectize();
@endif
addRemoveListener($clone);
});
function featureSelectedRender(item, escape) {
return '<div><span>' + escape(item["text"].trim()) + ' (' + escape(item["optgroup"].trim()) + ')' + '</span></div>';
}
function addRemoveListener($node) {
$node.find('.feature-remove').on('click', function(e) {
e.preventDefault();
$(this).parent().parent().parent().remove();
});
}
});
</script>

0 comments on commit c0accf4

Please sign in to comment.