Use const in secondary_toolbar.js

This commit is contained in:
Wojciech Maj 2019-12-22 18:20:30 +01:00
parent 6316b2a195
commit 5ea9127391
No known key found for this signature in database
GPG Key ID: 24A586806A31F908

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint no-var: error, prefer-const: error */
import { SCROLLBAR_PADDING, ScrollMode, SpreadMode } from './ui_utils'; import { SCROLLBAR_PADDING, ScrollMode, SpreadMode } from './ui_utils';
import { CursorTool } from './pdf_cursor_tools'; import { CursorTool } from './pdf_cursor_tools';
@ -172,8 +173,8 @@ class SecondaryToolbar {
for (const { element, eventName, close, eventDetails, } of this.buttons) { for (const { element, eventName, close, eventDetails, } of this.buttons) {
element.addEventListener('click', (evt) => { element.addEventListener('click', (evt) => {
if (eventName !== null) { if (eventName !== null) {
let details = { source: this, }; const details = { source: this, };
for (let property in eventDetails) { for (const property in eventDetails) {
details[property] = eventDetails[property]; details[property] = eventDetails[property];
} }
this.eventBus.dispatch(eventName, details); this.eventBus.dispatch(eventName, details);