Icons.getDomElement() -> Icons.getDOMElement()
This commit is contained in:
parent
47094fc4c3
commit
67d9e87c55
7 changed files with 20 additions and 20 deletions
|
@ -190,7 +190,7 @@ let domElementCache = {};
|
|||
* @param {String} icon
|
||||
* @returns {Element}
|
||||
*/
|
||||
module.exports.getDomElement = function (icon) {
|
||||
module.exports.getDOMElement = function (icon) {
|
||||
if (domElementCache[icon]) return domElementCache[icon].cloneNode(true);
|
||||
if (!module.exports[icon]) {
|
||||
Zotero.debug(`Attempting to get non-existant icon ${icon}`);
|
||||
|
|
|
@ -31,7 +31,7 @@ const cx = require('classnames');
|
|||
const JSWindow = require('./js-window');
|
||||
const Draggable = require('./draggable');
|
||||
const { injectIntl } = require('react-intl');
|
||||
const { IconDownChevron, getDomElement } = require('components/icons');
|
||||
const { IconDownChevron, getDOMElement } = require('components/icons');
|
||||
|
||||
const RESIZER_WIDTH = 5; // px
|
||||
|
||||
|
@ -1343,7 +1343,7 @@ function renderCheckboxCell(index, data, column) {
|
|||
span.setAttribute('role', 'checkbox');
|
||||
span.setAttribute('aria-checked', data);
|
||||
if (data) {
|
||||
span.appendChild(getDomElement('IconTick'));
|
||||
span.appendChild(getDOMElement('IconTick'));
|
||||
}
|
||||
return span;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ const LibraryTree = require('containers/libraryTree');
|
|||
const VirtualizedTable = require('components/virtualized-table');
|
||||
const { TreeSelectionStub } = VirtualizedTable;
|
||||
const Icons = require('components/icons');
|
||||
const { getDomElement: getDOMIcon } = Icons;
|
||||
const { getDOMElement: getDOMIcon } = Icons;
|
||||
const { getDragTargetOrient } = require('components/utils');
|
||||
const { Cc, Ci, Cu } = require('chrome');
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ const LibraryTree = require('containers/libraryTree');
|
|||
const VirtualizedTable = require('components/virtualized-table');
|
||||
const { renderCell, TreeSelectionStub } = VirtualizedTable;
|
||||
const Icons = require('components/icons');
|
||||
const { getDomElement } = Icons;
|
||||
const { getDOMElement } = Icons;
|
||||
const { COLUMNS } = require('containers/itemTreeColumns');
|
||||
const { Cc, Ci, Cu } = require('chrome');
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
|
@ -54,7 +54,7 @@ function makeItemRenderer(itemTree) {
|
|||
twisty.classList.add("spacer-twisty");
|
||||
}
|
||||
else {
|
||||
twisty = getDomElement("IconTwisty");
|
||||
twisty = getDOMElement("IconTwisty");
|
||||
twisty.classList.add('twisty');
|
||||
if (itemTree.isContainerOpen(index)) {
|
||||
twisty.classList.add('open');
|
||||
|
@ -71,7 +71,7 @@ function makeItemRenderer(itemTree) {
|
|||
const item = itemTree.getRow(index).ref;
|
||||
let retracted = "";
|
||||
if (Zotero.Retractions.isRetracted(item)) {
|
||||
retracted = getDomElement('IconCross');
|
||||
retracted = getDOMElement('IconCross');
|
||||
retracted.classList.add("retracted");
|
||||
}
|
||||
|
||||
|
@ -108,11 +108,11 @@ function makeItemRenderer(itemTree) {
|
|||
const state = item.getBestAttachmentStateCached();
|
||||
let icon = "";
|
||||
if (state === 1) {
|
||||
icon = getDomElement('IconBulletBlue');
|
||||
icon = getDOMElement('IconBulletBlue');
|
||||
icon.classList.add('cell-icon');
|
||||
}
|
||||
else if (state === -1) {
|
||||
icon = getDomElement('IconBulletBlueEmpty');
|
||||
icon = getDOMElement('IconBulletBlueEmpty');
|
||||
icon.classList.add('cell-icon');
|
||||
}
|
||||
span.append(icon);
|
||||
|
@ -128,7 +128,7 @@ function makeItemRenderer(itemTree) {
|
|||
const exists = item.fileExistsCached();
|
||||
let icon = "";
|
||||
if (exists !== null) {
|
||||
icon = exists ? getDomElement('IconBulletBlue') : getDomElement('IconBulletBlueEmpty');
|
||||
icon = exists ? getDOMElement('IconBulletBlue') : getDOMElement('IconBulletBlueEmpty');
|
||||
icon.classList.add('cell-icon');
|
||||
}
|
||||
span.append(icon);
|
||||
|
@ -3399,7 +3399,7 @@ var ItemTree = class ItemTree extends LibraryTree {
|
|||
if (!Icons[iconClsName]) {
|
||||
iconClsName = "IconTreeitem";
|
||||
}
|
||||
var icon = getDomElement(iconClsName);
|
||||
var icon = getDOMElement(iconClsName);
|
||||
if (!icon) {
|
||||
Zotero.debug('Could not find tree icon for "' + itemType + '"');
|
||||
return document.createElementNS("http://www.w3.org/1999/xhtml", 'span');
|
||||
|
|
|
@ -31,7 +31,7 @@ Components.utils.import("resource://zotero/config.js");
|
|||
var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
var VirtualizedTable = require('components/virtualized-table');
|
||||
var { getDomElement } = require('components/icons');
|
||||
var { getDOMElement } = require('components/icons');
|
||||
var { IntlProvider } = require('react-intl');
|
||||
var { renderCell } = VirtualizedTable;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import VirtualizedTable from 'components/virtualized-table';
|
||||
const { IntlProvider } = require('react-intl');
|
||||
const { getDomElement } = require('components/icons');
|
||||
const { getDOMElement } = require('components/icons');
|
||||
const { renderCell } = VirtualizedTable;
|
||||
|
||||
let _progressIndicator = null;
|
||||
|
@ -37,13 +37,13 @@ let _tree;
|
|||
|
||||
function _getImageByStatus(status) {
|
||||
if (status === Zotero.ProgressQueue.ROW_PROCESSING) {
|
||||
return getDomElement('IconArrowRefresh');
|
||||
return getDOMElement('IconArrowRefresh');
|
||||
}
|
||||
else if (status === Zotero.ProgressQueue.ROW_FAILED) {
|
||||
return getDomElement('IconCross');
|
||||
return getDOMElement('IconCross');
|
||||
}
|
||||
else if (status === Zotero.ProgressQueue.ROW_SUCCEEDED) {
|
||||
return getDomElement('IconTick');
|
||||
return getDOMElement('IconTick');
|
||||
}
|
||||
return document.createElementNS("http://www.w3.org/1999/xhtml", 'span');
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import VirtualizedTable from 'components/virtualized-table';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { getDomElement } from 'components/icons';
|
||||
import { getDOMElement } from 'components/icons';
|
||||
|
||||
/**
|
||||
* Front end for recognizing PDFs
|
||||
|
@ -712,7 +712,7 @@ var Zotero_RTFScan = new function() {
|
|||
if (column.primary) {
|
||||
let twisty;
|
||||
if (row.children || (this._rows[index + 1] && this._rows[index + 1].parent == row)) {
|
||||
twisty = getDomElement("IconTwisty");
|
||||
twisty = getDOMElement("IconTwisty");
|
||||
twisty.classList.add('twisty');
|
||||
if (!row.collapsed) {
|
||||
twisty.classList.add('open');
|
||||
|
@ -743,10 +743,10 @@ var Zotero_RTFScan = new function() {
|
|||
span.className = `cell action ${column.className}`;
|
||||
if (row.parent) {
|
||||
if (row.action) {
|
||||
span.appendChild(getDomElement('IconRTFScanAccept'));
|
||||
span.appendChild(getDOMElement('IconRTFScanAccept'));
|
||||
}
|
||||
else {
|
||||
span.appendChild(getDomElement('IconRTFScanLink'));
|
||||
span.appendChild(getDOMElement('IconRTFScanLink'));
|
||||
}
|
||||
span.addEventListener('mouseup', e => this._onActionMouseUp(e, index), { passive: true });
|
||||
span.style.pointerEvents = 'auto';
|
||||
|
|
Loading…
Reference in a new issue