| <!-- |
| Copyright (C) 2017 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <link rel="import" href="../../../bower_components/polymer/polymer.html"> |
| |
| <link rel="import" href="../../../bower_components/paper-input/paper-input.html"> |
| <link rel="import" href="../../core/gr-navigation/gr-navigation.html"> |
| <link rel="import" href="../../shared/gr-autocomplete/gr-autocomplete.html"> |
| <link rel="import" href="../../shared/gr-button/gr-button.html"> |
| <link rel="import" href="../../shared/gr-confirm-dialog/gr-confirm-dialog.html"> |
| <link rel="import" href="../../shared/gr-dropdown/gr-dropdown.html"> |
| <link rel="import" href="../../shared/gr-overlay/gr-overlay.html"> |
| |
| <link rel="import" href="../../../styles/shared-styles.html"> |
| |
| <dom-module id="gr-edit-controls"> |
| <template> |
| <style include="shared-styles"> |
| :host { |
| align-items: center; |
| display: flex; |
| justify-content: flex-end; |
| } |
| .invisible { |
| display: none; |
| } |
| gr-button { |
| margin-left: 1em; |
| text-decoration: none; |
| } |
| paper-input { |
| --paper-input-container: { |
| padding: 0; |
| min-width: 15em; |
| } |
| --paper-input-container-input: { |
| font-size: 1em; |
| } |
| } |
| gr-confirm-dialog { |
| width: 50em; |
| } |
| gr-confirm-dialog .main { |
| width: 100%; |
| } |
| </style> |
| <template is="dom-repeat" items="[[_actions]]" as="action"> |
| <gr-button |
| id$="[[action.key]]" |
| link |
| on-tap="_handleTap">[[action.label]]</gr-button> |
| </template> |
| <gr-overlay id="overlay" with-backdrop> |
| <gr-confirm-dialog |
| id="editDialog" |
| class="invisible" |
| disabled$="[[!_isValidPath(_path)]]" |
| confirm-label="Edit" |
| on-confirm="_handleEditConfirm" |
| on-cancel="_handleDialogCancel"> |
| <div class="header">Edit a file</div> |
| <div class="main"> |
| <!-- TODO(kaspern): Make this an autocomplete. --> |
| <paper-input |
| class="input" |
| label="Enter an existing or new full file path." |
| value="{{_path}}"></paper-input> |
| </div> |
| </gr-confirm-dialog> |
| </gr-overlay> |
| </template> |
| <script src="gr-edit-controls.js"></script> |
| </dom-module> |