diff options
Diffstat (limited to 'chromium/ui/webui/resources/cr_elements/cr_link_row')
3 files changed, 114 insertions, 0 deletions
diff --git a/chromium/ui/webui/resources/cr_elements/cr_link_row/compiled_resources2.gyp b/chromium/ui/webui/resources/cr_elements/cr_link_row/compiled_resources2.gyp new file mode 100644 index 00000000000..11ed485f750 --- /dev/null +++ b/chromium/ui/webui/resources/cr_elements/cr_link_row/compiled_resources2.gyp @@ -0,0 +1,13 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + 'target_name': 'cr_link_row', + 'dependencies': [ + ], + 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], + }, + ], +} diff --git a/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.html b/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.html new file mode 100644 index 00000000000..0ea10f6da08 --- /dev/null +++ b/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.html @@ -0,0 +1,74 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html"> +<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/default-theme.html"> + +<dom-module id="cr-link-row"> + <template strip-whitespace=""> + <style include="cr-hidden-style cr-icons"> + :host { + background: none; + border: none; + color: inherit; + cursor: pointer; + font-size: 100%; /* Specifically for Mac OSX, harmless elsewhere. */ + line-height: 154%; /* 20px. */ + margin: 0; + outline: none; + padding: 0; + position: relative; + width: 100%; + @apply(--cr-section); + } + + :host(.continuation), + :host(.first) { + border-top: none; + } + + :host([disabled]) { + color: var(--paper-grey-500); + cursor: auto; + pointer-events: none; + } + + #label, + #subLabel { + display: flex; + } + + #labelWrapper { + flex: 1; + flex-basis: 0.000000001px; + } + + #outer { + align-items: center; + display: flex; + min-height: var(--cr-section-two-line-min-height); + width: 100%; + } + + #outer[noSubLabel] { + min-height: var(--cr-section-min-height); + } + + #subLabel { + /* TODO(dschuyler): replace with: @apply(--cr-secondary-text); */ + color: var(--paper-grey-600); + font-weight: 400; + } + </style> + <div id="outer" noSubLabel$="[[!subLabel]]"> + <div id="labelWrapper" hidden="[[!label]]"> + <div id="label" class="label">[[label]]</div> + <div id="subLabel" class="secondary label">[[subLabel]]</div> + </div> + <button class$="[[iconClass]]" is="paper-icon-button-light"></button> + </div> + </template> + <script src="cr_link_row.js"></script> +</dom-module> diff --git a/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.js b/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.js new file mode 100644 index 00000000000..e700b6d9c2d --- /dev/null +++ b/chromium/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.js @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * A link row is a UI element similar to a button, though usually wider than a + * button (taking up the whole 'row'). The name link comes from the intended use + * of this element to take the user to another page in the app or to an external + * page (somewhat like an HTML link). + */ +Polymer({ + is: 'cr-link-row', + extends: 'button', + + properties: { + iconClass: String, + + label: String, + + subLabel: { + type: String, + /* Value used for noSubLabel attribute. */ + value: '', + }, + }, +}); |