mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fix more than one plugin highlighted at once.
When switching the conflict filter between different plugins. Fixes #420.
This commit is contained in:
@@ -355,10 +355,6 @@ loot-clear-metadata
|
||||
return this.shadowRoot.getElementById('editor').readFromEditor(oldData);
|
||||
},
|
||||
|
||||
deactivateConflictFilter: function() {
|
||||
this.shadowRoot.getElementById('showOnlyConflicts').checked = false;
|
||||
},
|
||||
|
||||
onShowOnlyConflicts: function(evt) {
|
||||
evt.target.dispatchEvent(new CustomEvent('loot-filter-conflicts', {
|
||||
bubbles: true,
|
||||
|
||||
@@ -470,20 +470,21 @@ function onEditorClose(evt) {
|
||||
document.getElementById('cardsNav').updateSize();
|
||||
}
|
||||
function onConflictsFilter(evt) {
|
||||
/* Deactivate any existing plugin conflict filter. */
|
||||
for (var i = 0; i < loot.game.plugins.length; ++i) {
|
||||
if (loot.game.plugins[i].id != evt.target.id) {
|
||||
loot.game.plugins[i].isConflictFilterChecked = false;
|
||||
}
|
||||
}
|
||||
/* Un-highlight any existing filter plugin. */
|
||||
var cards = document.getElementById('main').getElementsByTagName('loot-plugin-card');
|
||||
for (var i = 0; i < cards.length; ++i) {
|
||||
cards[i].classList.toggle('highlight', false);
|
||||
}
|
||||
/* evt.detail is true if the filter has been activated. */
|
||||
if (evt.detail) {
|
||||
/* Un-highlight any existing filter plugin. */
|
||||
var cards = document.getElementById('main').getElementsByTagName('loot-plugin-card');
|
||||
for (var i = 0; i < cards.length; ++i) {
|
||||
cards[i].classList.toggle('highlight', false);
|
||||
if (cards[i] != evt.target) {
|
||||
cards[i].deactivateConflictFilter();
|
||||
}
|
||||
}
|
||||
evt.target.classList.toggle('highlight', true);
|
||||
document.body.setAttribute('data-conflicts', evt.target.getName());
|
||||
} else {
|
||||
evt.target.classList.toggle('highlight', false);
|
||||
document.body.removeAttribute('data-conflicts');
|
||||
}
|
||||
setFilteredUIData(evt);
|
||||
|
||||
Reference in New Issue
Block a user