diff --git a/app/Resources/views/Search/display-zoom.html.twig b/app/Resources/views/Search/display-zoom.html.twig index 1cbdf083..34c6dfcf 100755 --- a/app/Resources/views/Search/display-zoom.html.twig +++ b/app/Resources/views/Search/display-zoom.html.twig @@ -129,7 +129,7 @@ {% for mwl_info in card.mwl_info %} {% if mwl_info.active %}class="legality-{{ mwl_info.legality }}"{% endif %} {% endfor %}> Standard Ban List - (show history) + (show history) diff --git a/web/js/zoom.js b/web/js/zoom.js index eedc46e8..d7e6ab51 100755 --- a/web/js/zoom.js +++ b/web/js/zoom.js @@ -5,6 +5,7 @@ $(function () { $(window.document).on('click', '.review-button', write_review_open); $(window.document).on('click', '.review-social-icon-like', like_review); $(window.document).on('click', '.btn-write-comment', write_comment); + $(window.document).on('click', '#mwl-history', show_mwl_history); $(window.document).on('submit', 'form.form-comment', form_comment_submit); }); @@ -349,3 +350,12 @@ function write_review_open(event) { } } + +function show_mwl_history(event) { + event.preventDefault(); + let entries = $.find('tr.card-mwl-inactive'); + entries.forEach(x => x.style.display = (x.style.display == 'table-row' ? 'none' : 'table-row')); + let l = event.currentTarget; + l.text = l.text == '(show history)' ? '(show only latest)' : '(show history)'; + return false; +}