|
@@ -217,9 +217,13 @@ class OutputWaiter {
|
|
|
*/
|
|
|
removeAllOutputs() {
|
|
|
this.outputs = {};
|
|
|
- const tabs = document.getElementById("output-tabs").children;
|
|
|
- for (let i = tabs.length - 1; i >= 0; i--) {
|
|
|
- tabs.item(i).remove();
|
|
|
+ const tabsList = document.getElementById("output-tabs");
|
|
|
+ const tabsListChildren = tabsList.children;
|
|
|
+
|
|
|
+ tabsList.classList.remove("tabs-left");
|
|
|
+ tabsList.classList.remove("tabs-right");
|
|
|
+ for (let i = tabsListChildren.length - 1; i >= 0; i--) {
|
|
|
+ tabsListChildren.item(i).remove();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -935,8 +939,8 @@ class OutputWaiter {
|
|
|
*/
|
|
|
refreshTabs(activeTab, direction) {
|
|
|
const newNums = this.getNearbyNums(activeTab, direction),
|
|
|
- tabsLeft = (newNums[0] !== this.getSmallestInputNum()),
|
|
|
- tabsRight = (newNums[newNums.length - 1] !== this.getLargestInputNum());
|
|
|
+ tabsLeft = (newNums[0] !== this.getSmallestInputNum() && newNums.length > 0),
|
|
|
+ tabsRight = (newNums[newNums.length - 1] !== this.getLargestInputNum() && newNums.length > 0);
|
|
|
|
|
|
this.manager.tabs.refreshOutputTabs(newNums, activeTab, tabsLeft, tabsRight);
|
|
|
|
|
@@ -1149,14 +1153,14 @@ class OutputWaiter {
|
|
|
* Handler for copy click events.
|
|
|
* Copies the output to the clipboard
|
|
|
*/
|
|
|
- copyClick() {
|
|
|
+ async copyClick() {
|
|
|
const dish = this.getOutputDish(this.manager.tabs.getActiveOutputTab());
|
|
|
if (dish === null) {
|
|
|
this.app.alert("Could not find data to copy. Has this output been baked yet?", 3000);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const output = dish.get(Dish.STRING);
|
|
|
+ const output = await dish.get(Dish.STRING);
|
|
|
|
|
|
// Create invisible textarea to populate with the raw dish string (not the printable version that
|
|
|
// contains dots instead of the actual bytes)
|
|
@@ -1331,7 +1335,7 @@ class OutputWaiter {
|
|
|
if (Object.prototype.hasOwnProperty.call(output, "data") &&
|
|
|
output.data &&
|
|
|
Object.prototype.hasOwnProperty.call(output.data, "dish")) {
|
|
|
- const data = output.data.dish.get(Dish.STRING);
|
|
|
+ const data = await output.data.dish.get(Dish.STRING);
|
|
|
if (contentFilterExp.test(data)) {
|
|
|
results.push({
|
|
|
inputNum: iNum,
|