Ben Rohlfs | e3b4542 | 2019-06-07 09:36:34 +0200 | [diff] [blame] | 1 | /** |
| 2 | * @license |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 3 | * Copyright (C) 2015 The Android Open Source Project |
Ben Rohlfs | e3b4542 | 2019-06-07 09:36:34 +0200 | [diff] [blame] | 4 | * |
| 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 none | d55afa0 | 2020-04-20 14:35:53 +0000 | [diff] [blame] | 17 | |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 18 | import {safeTypesBridge} from '../utils/safe-types-util'; |
| 19 | import './gr-app-init'; |
| 20 | import './font-roboto-local-loader'; |
Dmitrii Filippov | 1f9cac8 | 2020-04-23 15:08:21 +0200 | [diff] [blame] | 21 | // Sets up global Polymer variable, because plugins requires it. |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 22 | import '../scripts/bundled-polymer'; |
Paladox none | 96933d9 | 2020-04-20 14:01:34 +0000 | [diff] [blame] | 23 | |
| 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 Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 30 | import { |
| 31 | setPassiveTouchGestures, |
| 32 | setCancelSyntheticClickEvents, |
| 33 | } from '@polymer/polymer/lib/utils/settings'; |
Paladox none | 96933d9 | 2020-04-20 14:01:34 +0000 | [diff] [blame] | 34 | setCancelSyntheticClickEvents(false); |
Paladox none | 47c740c | 2020-06-24 16:51:31 +0000 | [diff] [blame] | 35 | setPassiveTouchGestures(true); |
Paladox none | 96933d9 | 2020-04-20 14:01:34 +0000 | [diff] [blame] | 36 | |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 37 | import {initGlobalVariables} from './gr-app-global-var-init'; |
| 38 | import './gr-app-element'; |
| 39 | import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners'; |
| 40 | import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin'; |
| 41 | import {PolymerElement} from '@polymer/polymer/polymer-element'; |
| 42 | import {htmlTemplate} from './gr-app_html'; |
| 43 | import {initGerritPluginApi} from './shared/gr-js-api-interface/gr-gerrit'; |
| 44 | import {customElement} from '@polymer/decorators'; |
| 45 | import {installPolymerResin} from '../scripts/polymer-resin-install'; |
Dmitrii Filippov | 3fd2b10 | 2019-11-15 16:16:46 +0100 | [diff] [blame] | 46 | |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 47 | installPolymerResin(safeTypesBridge); |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 48 | |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 49 | @customElement('gr-app') |
| 50 | class GrApp extends GestureEventListeners(LegacyElementMixin(PolymerElement)) { |
| 51 | static get template() { |
| 52 | return htmlTemplate; |
| 53 | } |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 54 | } |
| 55 | |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 56 | declare global { |
| 57 | interface HTMLElementTagNameMap { |
| 58 | 'gr-app': GrApp; |
| 59 | } |
| 60 | } |
Dmitrii Filippov | 35aea69 | 2020-04-07 12:14:11 +0200 | [diff] [blame] | 61 | |
| 62 | initGlobalVariables(); |
Dmitrii Filippov | 6a03800 | 2020-10-14 18:50:07 +0200 | [diff] [blame] | 63 | initGerritPluginApi(); |