aboutsummaryrefslogtreecommitdiff
path: root/client/js/views/pools_header_view.js
diff options
context:
space:
mode:
authorShyam Sunder2020-06-05 18:03:37 -0400
committerShyam Sunder2020-06-06 08:58:23 -0400
commit57193b57157b7a42896c887a2d5930493ac7b290 (patch)
tree9555453a944caae64d8a00e4b073482d9e7fb244 /client/js/views/pools_header_view.js
parentc06aaa63af977e64ef08bfba7829214f0f0ed38e (diff)
client+server: implement code autoformatting using prettier and black
Diffstat (limited to 'client/js/views/pools_header_view.js')
-rw-r--r--client/js/views/pools_header_view.js45
1 files changed, 27 insertions, 18 deletions
diff --git a/client/js/views/pools_header_view.js b/client/js/views/pools_header_view.js
index 65bbe1b..cfc6c8b 100644
--- a/client/js/views/pools_header_view.js
+++ b/client/js/views/pools_header_view.js
@@ -1,13 +1,12 @@
-'use strict';
+"use strict";
-const events = require('../events.js');
-const misc = require('../util/misc.js');
-const search = require('../util/search.js');
-const views = require('../util/views.js');
-const PoolAutoCompleteControl =
- require('../controls/pool_auto_complete_control.js');
+const events = require("../events.js");
+const misc = require("../util/misc.js");
+const search = require("../util/search.js");
+const views = require("../util/views.js");
+const PoolAutoCompleteControl = require("../controls/pool_auto_complete_control.js");
-const template = views.getTemplate('pools-header');
+const template = views.getTemplate("pools-header");
class PoolsHeaderView extends events.EventTarget {
constructor(ctx) {
@@ -20,31 +19,41 @@ class PoolsHeaderView extends events.EventTarget {
this._autoCompleteControl = new PoolAutoCompleteControl(
this._queryInputNode,
{
- confirm: pool => this._autoCompleteControl.replaceSelectedText(
- misc.escapeSearchTerm(pool.names[0]), true),
- });
+ confirm: (pool) =>
+ this._autoCompleteControl.replaceSelectedText(
+ misc.escapeSearchTerm(pool.names[0]),
+ true
+ ),
+ }
+ );
}
search.searchInputNodeFocusHelper(this._queryInputNode);
- this._formNode.addEventListener('submit', e => this._evtSubmit(e));
+ this._formNode.addEventListener("submit", (e) => this._evtSubmit(e));
}
get _formNode() {
- return this._hostNode.querySelector('form');
+ return this._hostNode.querySelector("form");
}
get _queryInputNode() {
- return this._hostNode.querySelector('[name=search-text]');
+ return this._hostNode.querySelector("[name=search-text]");
}
_evtSubmit(e) {
e.preventDefault();
this._queryInputNode.blur();
- this.dispatchEvent(new CustomEvent('navigate', {detail: {parameters: {
- query: this._queryInputNode.value,
- page: 1,
- }}}));
+ this.dispatchEvent(
+ new CustomEvent("navigate", {
+ detail: {
+ parameters: {
+ query: this._queryInputNode.value,
+ page: 1,
+ },
+ },
+ })
+ );
}
}

© 2015 - 2026 Jakob L. Kreuze