From 24dd0cb562378f5c43c779e0168efd35a5d3479b Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 16 Jul 2017 12:01:39 -0500 Subject: [PATCH] More cleanup --- edit/edit.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index 6eb0406b..f8e63006 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -441,9 +441,11 @@ document.addEventListener('wheel', event => { queryTabs({currentWindow: true}).then(tabs => { const windowId = tabs[0].windowId; if (prefs.get('openEditInWindow')) { - if (sessionStorage.saveSizeOnClose - && 'left' in prefs.get('windowPosition', {}) - && !isWindowMaximized()) { + if ( + sessionStorage.saveSizeOnClose && + 'left' in prefs.get('windowPosition', {}) && + !isWindowMaximized() + ) { // window was reopened via Ctrl-Shift-T etc. chrome.windows.update(windowId, prefs.get('windowPosition')); } @@ -481,10 +483,10 @@ function goBackToManage(event) { } function isWindowMaximized() { - return window.screenLeft == 0 - && window.screenTop == 0 - && window.outerWidth == screen.availWidth - && window.outerHeight == screen.availHeight; + return window.screenLeft == 0 && + window.screenTop == 0 && + window.outerWidth == screen.availWidth && + window.outerHeight == screen.availHeight; } window.onbeforeunload = () => { @@ -570,8 +572,10 @@ function addSection(event, section) { item.querySelector('.applies-value').value.trim()); div.classList.toggle('has-regexp', show); appliesTo.oninput = appliesTo.oninput || show && (event => { - if (event.target.matches('.applies-value') - && event.target.parentElement.querySelector('.applies-type').value == 'regexp') { + if ( + event.target.matches('.applies-value') && + event.target.parentElement.querySelector('.applies-type').value == 'regexp' + ) { showRegExpTester(null, div); } }); @@ -736,8 +740,11 @@ function setupGlobalSearch() { const rxQuery = typeof state.query == 'object' ? state.query : stringAsRegExp(state.query, shouldIgnoreCase(state.query) ? 'i' : ''); - if (document.activeElement && document.activeElement.name == 'applies-value' - && searchAppliesTo(activeCM)) { + if ( + document.activeElement && + document.activeElement.name == 'applies-value' && + searchAppliesTo(activeCM) + ) { return; } let cm = activeCM;