mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Some misc. tidying up of editor-related code
This commit is contained in:
@@ -25,7 +25,6 @@ loot-clear-metadata
|
||||
<link rel="import" href="../../../../bower_components/paper-toolbar/paper-toolbar.html">
|
||||
<link rel="import" href="../../../../bower_components/paper-tooltip/paper-tooltip.html">
|
||||
|
||||
<link rel="import" href="loot-plugin-editor.html">
|
||||
<link rel="import" href="loot-custom-icons.html">
|
||||
<link rel="import" href="loot-menu.html">
|
||||
|
||||
|
||||
@@ -229,27 +229,20 @@ loot-editor-close
|
||||
attached() {
|
||||
this.$.accept.addEventListener('click', this._onHideEditor);
|
||||
this.$.cancel.addEventListener('click', this._onHideEditor);
|
||||
this.$.tablePages.addEventListener('iron-deselect', this._onTablePageActivate);
|
||||
this.$.splitter.addEventListener('track', this._onSplitterDrag);
|
||||
},
|
||||
|
||||
detached() {
|
||||
this.$.accept.removeEventListener('click', this._onHideEditor);
|
||||
this.$.cancel.removeEventListener('click', this._onHideEditor);
|
||||
this.$.tablePages.removeEventListener('iron-deselect', this._onTablePageActivate);
|
||||
this.$.splitter.removeEventListener('track', this._onSplitterDrag);
|
||||
},
|
||||
|
||||
_onTablePageActivate() {
|
||||
/* Notify that this editor (may have) changed size. */
|
||||
this.dispatchEvent(new CustomEvent('iron-resize', { bubbles: true }));
|
||||
},
|
||||
|
||||
_onSplitterDrag(evt) {
|
||||
if (evt.detail.state === 'start') {
|
||||
this.parentNode.host.style.height = parseInt(window.getComputedStyle(this.parentNode.host).height) + 'px';
|
||||
this.parentNode.host.style.height = parseInt(window.getComputedStyle(this.parentNode.host).height, 10) + 'px';
|
||||
}
|
||||
this.parentNode.host.style.height = (parseInt(this.parentNode.host.style.height) - evt.detail.ddy) + 'px';
|
||||
this.parentNode.host.style.height = (parseInt(this.parentNode.host.style.height, 10) - evt.detail.ddy) + 'px';
|
||||
},
|
||||
|
||||
_rowDataToMessage(rowData) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<link rel="import" href="elements/loot-message-dialog.html">
|
||||
<link rel="import" href="elements/loot-plugin-item.html">
|
||||
<link rel="import" href="elements/loot-plugin-card.html">
|
||||
<link rel="import" href="elements/loot-plugin-editor.html">
|
||||
<link rel="import" href="elements/loot-search-toolbar.html">
|
||||
|
||||
<link rel="import" href="../../../bower_components/iron-flex-layout/iron-flex-layout.html">
|
||||
|
||||
@@ -452,7 +452,7 @@ function onEditorClose(evt) {
|
||||
majority of the work to the C++ side of things. */
|
||||
const plugin = loot.game.plugins.find((item) => {
|
||||
return item.name === evt.target.querySelector('h1').textContent;
|
||||
})
|
||||
});
|
||||
const edits = evt.target.readFromEditor(plugin);
|
||||
promise = loot.query('editorClosed', edits).then(JSON.parse).then((result) => {
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user