blob: f19931f7e7976fb3c8e0d897d302912f6b38491b [file] [log] [blame]
Ben Rohlfse3b45422019-06-07 09:36:34 +02001/**
2 * @license
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +01003 * Copyright (C) 2015 The Android Open Source Project
Ben Rohlfse3b45422019-06-07 09:36:34 +02004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Paladox noned55afa02020-04-20 14:35:53 +000017
Dmitrii Filippov6a038002020-10-14 18:50:07 +020018import {safeTypesBridge} from '../utils/safe-types-util';
19import './gr-app-init';
20import './font-roboto-local-loader';
Dmitrii Filippov1f9cac82020-04-23 15:08:21 +020021// Sets up global Polymer variable, because plugins requires it.
Dmitrii Filippov6a038002020-10-14 18:50:07 +020022import '../scripts/bundled-polymer';
Paladox none96933d92020-04-20 14:01:34 +000023
24/**
25 * setCancelSyntheticClickEvents is set to true by
26 * default which will cancel synthetic click events
27 * on older touch device.
28 * See https://github.com/Polymer/polymer/issues/5289
29 */
Dmitrii Filippov6a038002020-10-14 18:50:07 +020030import {
31 setPassiveTouchGestures,
32 setCancelSyntheticClickEvents,
33} from '@polymer/polymer/lib/utils/settings';
Paladox none96933d92020-04-20 14:01:34 +000034setCancelSyntheticClickEvents(false);
Paladox none47c740c2020-06-24 16:51:31 +000035setPassiveTouchGestures(true);
Paladox none96933d92020-04-20 14:01:34 +000036
Dmitrii Filippov6a038002020-10-14 18:50:07 +020037import {initGlobalVariables} from './gr-app-global-var-init';
38import './gr-app-element';
39import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners';
40import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin';
41import {PolymerElement} from '@polymer/polymer/polymer-element';
42import {htmlTemplate} from './gr-app_html';
43import {initGerritPluginApi} from './shared/gr-js-api-interface/gr-gerrit';
44import {customElement} from '@polymer/decorators';
45import {installPolymerResin} from '../scripts/polymer-resin-install';
Dmitrii Filippov3fd2b102019-11-15 16:16:46 +010046
Dmitrii Filippov6a038002020-10-14 18:50:07 +020047installPolymerResin(safeTypesBridge);
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010048
Dmitrii Filippov6a038002020-10-14 18:50:07 +020049@customElement('gr-app')
50class GrApp extends GestureEventListeners(LegacyElementMixin(PolymerElement)) {
51 static get template() {
52 return htmlTemplate;
53 }
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010054}
55
Dmitrii Filippov6a038002020-10-14 18:50:07 +020056declare global {
57 interface HTMLElementTagNameMap {
58 'gr-app': GrApp;
59 }
60}
Dmitrii Filippov35aea692020-04-07 12:14:11 +020061
62initGlobalVariables();
Dmitrii Filippov6a038002020-10-14 18:50:07 +020063initGerritPluginApi();