Fix editor priority fields not updating correctly.

If an editor is opened, then a masterlist update performed, LOOT wasn't
updating the editor priority fields to account for any priority change.
Fixes #362.
This commit is contained in:
Oliver Hamlet
2014-12-23 19:17:51 +00:00
parent f7ce535030
commit 30bf3277fb
@@ -250,6 +250,11 @@ loot-editor-close
</template>
<script>
Polymer({
observe: {
'data.isGlobalPriority': 'onPriorityChange',
'data.modPriority': 'onPriorityChange',
},
attached: function() {
this.shadowRoot.getElementById('tableTabs').addEventListener('core-select', this.onTabSelect, false);
@@ -284,6 +289,14 @@ loot-editor-close
}
},
onPriorityChange: function(oldValue, newValue) {
/* Handle priority change due to masterlist update. */
if (this.data) {
/* Set the new editor data. */
this.setEditorData(this.data);
}
},
readFromEditor: function(oldData) {
/* Need to turn all the editor controls' values into data to
process. The control values can be compared with the existing