blob: a4658b07e56d33538e5c76c857a46484781bb550 [file] [log] [blame]
Akron2d0d96d2019-11-18 19:49:50 +01001/**
2 * The query panel
3 *
4 * @author Nils Diewald
5 */
Akron14f3ee92020-10-19 11:59:40 +02006"use strict";
7
Akron2d0d96d2019-11-18 19:49:50 +01008define([
9 'panel'
10], function (panelClass) {
11
12 const d = document;
13
14 // Localization values
15 const loc = KorAP.Locale;
16
17 return {
18 create : function (opened) {
19 return Object.create(panelClass)._init(['query']).upgradeTo(this)._init(opened);
20 },
21
22 // Initialize panel
23 _init : function (opened) {
24 this._opened = opened;
Akron37ea1192021-07-28 10:40:14 +020025 const a = this.actions();
hebastaf6adf8d2019-11-26 14:04:10 +010026
Akron2d0d96d2019-11-18 19:49:50 +010027 // If plugins are enabled, add all buttons for the query panel
28 if (KorAP.Plugin) {
Akron2d0d96d2019-11-18 19:49:50 +010029
30 // Add all matchbuttons in order
Akron14f3ee92020-10-19 11:59:40 +020031 KorAP.Plugin
32 .buttonGroup("query")
33 .forEach(i => a.add.apply(a, i));
Akron2d0d96d2019-11-18 19:49:50 +010034
hebastaf6adf8d2019-11-26 14:04:10 +010035 KorAP.Plugin.clearButtonGroup("query")
Akron2d0d96d2019-11-18 19:49:50 +010036 };
37
38 return this;
39 }
40 }
41});