Fix eslint errors in mergeGroup.js

This commit is contained in:
windingwind 2024-05-16 21:14:31 +08:00 committed by Dan Stillman
parent 14c6d26f20
commit 1f322cddb8

View file

@ -68,6 +68,7 @@
get data() { get data() {
return this._data; return this._data;
} }
set data(val) { set data(val) {
this._data = val; this._data = val;
this.refresh(); this.refresh();
@ -80,6 +81,7 @@
get type() { get type() {
return this._type; return this._type;
} }
set type(val) { set type(val) {
switch (val) { switch (val) {
case 'item': case 'item':
@ -90,7 +92,7 @@
break; break;
default: default:
throw new Error(`Unsupported merge object type '${type}'`); throw new Error(`Unsupported merge object type '${val}'`);
} }
this._type = val; this._type = val;
@ -100,9 +102,11 @@
set leftCaption(val) { set leftCaption(val) {
this._leftPane.caption = val; this._leftPane.caption = val;
} }
set rightCaption(val) { set rightCaption(val) {
this._rightPane.caption = val; this._rightPane.caption = val;
} }
set mergeCaption(val) { set mergeCaption(val) {
this._mergePane.caption = val; this._mergePane.caption = val;
} }
@ -110,9 +114,11 @@
get leftPane() { get leftPane() {
return this._leftPane; return this._leftPane;
} }
get rightPane() { get rightPane() {
return this._rightPane; return this._rightPane;
} }
get mergePane() { get mergePane() {
return this._mergePane; return this._mergePane;
} }
@ -124,7 +130,7 @@
// Check for note or attachment // Check for note or attachment
this.type = this._getTypeFromObject( this.type = this._getTypeFromObject(
this._data.left.deleted ? this._data.right : this._data.left this._data.left.deleted ? this._data.right : this._data.left
); );
var showButton = this.type != 'item'; var showButton = this.type != 'item';
@ -206,13 +212,12 @@
choosePane(pane) { choosePane(pane) {
Zotero.debug(new Error().stack); Zotero.debug(new Error().stack);
let otherPane;
if (pane.id == 'left-pane') { if (pane.id == 'left-pane') {
var position = 'left'; otherPane = this._rightPane;
var otherPane = this._rightPane;
} }
else { else {
var position = 'right'; otherPane = this._leftPane;
var otherPane = this._leftPane;
} }
pane.removeAttribute("selected"); pane.removeAttribute("selected");
@ -315,6 +320,7 @@
get deleted() { get deleted() {
return this._deleted; return this._deleted;
} }
set deleted(val) { set deleted(val) {
this._deleted = val; this._deleted = val;
@ -332,6 +338,7 @@
get data() { get data() {
return this._data; return this._data;
} }
set data(val) { set data(val) {
this._data = val; this._data = val;
@ -365,7 +372,6 @@
break; break;
case 'note': case 'note':
var type = Zotero.Libraries.get(this.libraryID).libraryType;
elementName = 'note-editor'; elementName = 'note-editor';
break; break;
@ -377,11 +383,12 @@
throw new Error("Object type '" + this.type + "' not supported"); throw new Error("Object type '" + this.type + "' not supported");
} }
let objbox;
if (elementName == 'div') { if (elementName == 'div') {
var objbox = document.createElement(elementName); objbox = document.createElement(elementName);
} }
else { else {
var objbox = document.createXULElement(elementName); objbox = document.createXULElement(elementName);
} }
var parentRow = this._class('parent-row'); var parentRow = this._class('parent-row');