Merge pull request #696 from SalavecJ/ui_annoyances
UI Anything Goes js annoyances
This commit is contained in:
@@ -96,7 +96,7 @@
|
|||||||
<span class="ui-icon ui-icon-suitcase"></span>
|
<span class="ui-icon ui-icon-suitcase"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="convertErrataBut" title="Convert to PC Errata" class="menu-button">
|
<button id="convertErrataBut" title="Convert to PC Errata" class="menu-button" disabled>
|
||||||
<span class="ui-icon ui-icon-transferthick-e-w"></span>
|
<span class="ui-icon ui-icon-transferthick-e-w"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
cardInfoDialog: null,
|
cardInfoDialog: null,
|
||||||
|
|
||||||
formats: null,
|
formats: null,
|
||||||
|
formatsInitialized:false,
|
||||||
|
|
||||||
init:function () {
|
init:function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
@@ -110,14 +111,14 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
that.setMapVisibility(false);
|
that.setMapVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//PC format or Anything Goes
|
//PC format or Anything Goes (if chosen, not when being default when page loads)
|
||||||
if(formatCode.includes("pc") || formatCode == "rev_tow_sta") {
|
if((formatCode.includes("pc") || formatCode == "rev_tow_sta") && that.formatsInitialized) {
|
||||||
$("#convertErrataBut").button("option", "disabled", false);
|
$("#convertErrataBut").button("option", "disabled", false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#convertErrataBut").button("option", "disabled", true);
|
$("#convertErrataBut").button("option", "disabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
that.cardFilter.updateFormat(formatCode, that.formats[formatCode].blockFilters);
|
that.cardFilter.updateFormat(formatCode, that.formats[formatCode].blockFilters);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1032,6 +1033,12 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
this.deckValidationDirty = true;
|
this.deckValidationDirty = true;
|
||||||
this.deckContentsDirty = true;
|
this.deckContentsDirty = true;
|
||||||
$("#editingDeck").html("<font color='orange'>*" + name + " - modified</font>");
|
$("#editingDeck").html("<font color='orange'>*" + name + " - modified</font>");
|
||||||
|
|
||||||
|
//Enable the errata button if user starts adding cards to empty 'Anything Goes' deck after the page was initialized
|
||||||
|
let formatCode = this.formatSelect.val();
|
||||||
|
if(formatCode == "rev_tow_sta") {
|
||||||
|
$("#convertErrataBut").button("option", "disabled", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1122,6 +1129,8 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||||
that.showNormalFilter();
|
that.showNormalFilter();
|
||||||
|
|
||||||
|
that.formatsInitialized = true;
|
||||||
|
|
||||||
that.getCollectionTypes();
|
that.getCollectionTypes();
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1118,8 +1118,9 @@ var GempLotrHallUI = Class.extend({
|
|||||||
for (var i = 0; i < formats.length; i++) {
|
for (var i = 0; i < formats.length; i++) {
|
||||||
var format = formats[i].childNodes[0].nodeValue;
|
var format = formats[i].childNodes[0].nodeValue;
|
||||||
var type = formats[i].getAttribute("type");
|
var type = formats[i].getAttribute("type");
|
||||||
|
|
||||||
var item = "<option value='" + type + "'>" + format + "</option>"
|
var selected = (format === "Fellowship Block") ? " selected" : "";
|
||||||
|
var item = "<option value='" + type + "'" + selected + ">" + format + "</option>";
|
||||||
|
|
||||||
this.supportedFormatsSelect.append(item);
|
this.supportedFormatsSelect.append(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user