Skip to content

Commit

Permalink
replace some util.getElement() with querySelector()
Browse files Browse the repository at this point in the history
  • Loading branch information
dteviot committed Aug 31, 2017
1 parent 11b89e6 commit 723006f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugin/js/ChapterUrlsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ class ChapterUrlsUI {
*/
static setAllUrlsSelectState(select) {
let linksTable = ChapterUrlsUI.getChapterUrlsTable();
for(let row of linksTable.children) {
let input = util.getElement(row, "input", i => i.type === "checkbox");
if ((input !== null) && (input.checked !== select)) {
for(let input of [...linksTable.querySelectorAll("input[type='checkbox']")]) {
if (input.checked !== select) {
input.checked = select;
input.onclick();
}
Expand Down Expand Up @@ -126,7 +125,7 @@ class ChapterUrlsUI {

/** @private */
static resizeTitleColumnToFit(linksTable, openAsTab) {
let inputs = util.getElements(linksTable, "input", i => i.type === "text");
let inputs = [...linksTable.querySelectorAll("input[type='text']")];
let width = inputs.reduce((acc, element) => Math.max(acc, element.value.length), 0);
if (!openAsTab) {
// if open as popup, don't allow column to be more than 1/2 window width
Expand Down

0 comments on commit 723006f

Please sign in to comment.