mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Update JS for API changes moving to iron-list
This commit is contained in:
@@ -40,8 +40,8 @@ function onChangeGame(evt) {
|
||||
loot.game = new loot.Game(gameInfo, loot.l10n);
|
||||
|
||||
/* Reset virtual list positions. */
|
||||
document.getElementById('cardsNav').scrollToItem(0);
|
||||
document.getElementById('main').lastElementChild.scrollToItem(0);
|
||||
document.getElementById('cardsNav').scrollToIndex(0);
|
||||
document.getElementById('main').lastElementChild.scrollToIndex(0);
|
||||
|
||||
/* Now update virtual lists. */
|
||||
filterPluginData(loot.game.plugins, loot.filters);
|
||||
@@ -70,8 +70,6 @@ function updateMasterlistNoProgress() {
|
||||
existingPlugin.tags = resultPlugin.tags;
|
||||
}
|
||||
});
|
||||
/* Hack to stop cards overlapping. */
|
||||
document.getElementById('main').lastElementChild.updateSize();
|
||||
|
||||
loot.Dialog.showNotification(loot.l10n.translate('Masterlist updated to revision %s.', loot.game.masterlist.revision));
|
||||
} else {
|
||||
@@ -356,7 +354,7 @@ function onSwitchSidebarTab(evt) {
|
||||
}
|
||||
function onSidebarClick(evt) {
|
||||
if (evt.target.hasAttribute('data-index')) {
|
||||
document.getElementById('main').lastElementChild.scrollToItem(evt.target.getAttribute('data-index'));
|
||||
document.getElementById('main').lastElementChild.scrollToIndex(evt.target.getAttribute('data-index'));
|
||||
|
||||
if (evt.type === 'dblclick') {
|
||||
const card = document.getElementById(evt.target.getAttribute('data-id'));
|
||||
@@ -439,7 +437,7 @@ function onEditorOpen(evt) {
|
||||
document.getElementById('sortButton').setAttribute('disabled', '');
|
||||
}
|
||||
document.body.setAttribute('data-editors', numEditors);
|
||||
document.getElementById('cardsNav').updateSize();
|
||||
document.getElementById('cardsNav').notifyResize();
|
||||
|
||||
return loot.query('editorOpened').catch(handlePromiseError);
|
||||
}
|
||||
@@ -500,7 +498,7 @@ function onEditorClose(evt) {
|
||||
} else {
|
||||
document.body.setAttribute('data-editors', numEditors);
|
||||
}
|
||||
document.getElementById('cardsNav').updateSize();
|
||||
document.getElementById('cardsNav').notifyResize();
|
||||
}).catch(handlePromiseError);
|
||||
}
|
||||
function undoConflictsFilter() {
|
||||
|
||||
@@ -44,8 +44,8 @@ function filterPluginData(plugins, filters) {
|
||||
filters.conflictingPluginNames = conflictingPluginNames;
|
||||
return plugins.filter(filters.pluginFilter, filters);
|
||||
}).then((filteredPlugins) => {
|
||||
document.getElementById('cardsNav').data = filteredPlugins;
|
||||
document.getElementById('pluginCardList').data = filteredPlugins;
|
||||
document.getElementById('cardsNav').items = filteredPlugins;
|
||||
document.getElementById('pluginCardList').items = filteredPlugins;
|
||||
|
||||
const pluginCards = document.getElementById('pluginCardList').children;
|
||||
for (let i = 0; i < pluginCards.length; ++i) {
|
||||
@@ -53,8 +53,7 @@ function filterPluginData(plugins, filters) {
|
||||
pluginCards[i].updateContent();
|
||||
}
|
||||
}
|
||||
document.getElementById('cardsNav').updateSize();
|
||||
document.getElementById('pluginCardList').updateSize();
|
||||
document.getElementById('cardsNav').notifyResize();
|
||||
|
||||
/* Now perform search again. If there is no current search, this won't
|
||||
do anything. */
|
||||
|
||||
@@ -222,8 +222,8 @@
|
||||
return query('getGameData').then((result) => {
|
||||
const game = JSON.parse(result, Plugin.fromJson);
|
||||
appData.game = new Game(game, appData.l10n);
|
||||
document.getElementById('cardsNav').data = appData.game.plugins;
|
||||
document.getElementById('main').lastElementChild.data = appData.game.plugins;
|
||||
document.getElementById('cardsNav').items = appData.game.plugins;
|
||||
document.getElementById('main').lastElementChild.items = appData.game.plugins;
|
||||
applyEnabledFilters(appData.filters, appData.settings, appData.game.plugins);
|
||||
Dialog.closeProgress();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user