Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html

Issue 2032313002: MD WebUI: Add loading spinner to cr-toolbar, hook into MD History toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <link rel="import" href="chrome://resources/html/polymer.html"> 1 <link rel="import" href="chrome://resources/html/polymer.html">
2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h tml"> 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.h tml">
3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html">
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input -container.html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input -container.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spi nner-lite.html">
calamity 2016/06/07 04:46:04 Wew.
5 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc h_field_behavior.html"> 6 <link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_searc h_field_behavior.html">
6 <link rel="import" href="chrome://resources/cr_elements/icons.html"> 7 <link rel="import" href="chrome://resources/cr_elements/icons.html">
7 8
8 <dom-module id="cr-toolbar-search-field"> 9 <dom-module id="cr-toolbar-search-field">
9 <template> 10 <template>
10 <style> 11 <style>
11 :host { 12 :host {
12 align-items: center; 13 align-items: center;
13 display: flex; 14 display: flex;
14 height: 40px; 15 height: 40px;
15 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), 16 transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
16 width 150ms cubic-bezier(0.4, 0, 0.2, 1); 17 width 150ms cubic-bezier(0.4, 0, 0.2, 1);
17 width: 44px; 18 width: 44px;
18 } 19 }
19 20
20 [hidden] { 21 [hidden] {
21 display: none !important; 22 display: none !important;
22 } 23 }
23 24
24 paper-icon-button { 25 paper-icon-button {
25 height: 32px; 26 height: 32px;
26 margin: 6px; 27 margin: 6px;
27 padding: 6px; 28 padding: 6px;
28 width: 32px; 29 width: 32px;
29 } 30 }
30 31
31 #icon { 32 #icon {
32 --paper-icon-button-ink-color: white; 33 --paper-icon-button-ink-color: white;
34 transition: opacity 150ms;
33 } 35 }
34 36
35 #prompt { 37 #prompt {
36 visibility: hidden; 38 visibility: hidden;
37 } 39 }
38 40
41 paper-spinner-lite {
42 --paper-spinner-color: white;
43 height: 20px;
44 margin: 0 6px;
45 padding: 6px;
46 position: absolute;
47 width: 20px;
48 }
49
39 paper-input-container { 50 paper-input-container {
40 --paper-input-container-input-color: white; 51 --paper-input-container-input-color: white;
41 --paper-input-container-underline: { 52 --paper-input-container-underline: {
42 display: none; 53 display: none;
43 }; 54 };
44 --paper-input-container-underline-focus: { 55 --paper-input-container-underline-focus: {
45 display: none; 56 display: none;
46 }; 57 };
47 --paper-input-container-label: { 58 --paper-input-container-label: {
48 color: inherit; 59 color: inherit;
(...skipping 14 matching lines...) Expand all
63 -webkit-padding-end: 0; 74 -webkit-padding-end: 0;
64 background: rgba(0, 0, 0, 0.22); 75 background: rgba(0, 0, 0, 0.22);
65 border-radius: 2px; 76 border-radius: 2px;
66 cursor: text; 77 cursor: text;
67 width: 580px; 78 width: 580px;
68 } 79 }
69 80
70 :host(:not([narrow]):not([showing-search])) #icon, 81 :host(:not([narrow]):not([showing-search])) #icon,
71 :host(:not([narrow]):not([showing-search])) #prompt { 82 :host(:not([narrow]):not([showing-search])) #prompt {
72 opacity: 0.6; 83 opacity: 0.6;
84 }
85
86 :host(:not([narrow]):not([showing-search])) #prompt {
73 visibility: visible; 87 visibility: visible;
74 } 88 }
75 89
76 /* Any layout, search open. */ 90 /* Any layout, search open. */
77 :host([showing-search]) { 91 :host([showing-search]) {
78 width: 100%; 92 width: 100%;
79 } 93 }
80 94
95 :host([showing-search][processing]) #icon {
96 opacity: 0;
97 }
98
81 :host([narrow][showing-search]) #icon { 99 :host([narrow][showing-search]) #icon {
82 -webkit-margin-start: 18px; 100 -webkit-margin-start: 18px;
83 } 101 }
84 </style> 102 </style>
103 <paper-spinner-lite
104 active="[[isSpinnerActive_(processing, showingSearch)]]">
105 </paper-spinner-lite>
85 <paper-icon-button id="icon" icon="cr:search" title="[[label]]" 106 <paper-icon-button id="icon" icon="cr:search" title="[[label]]"
86 tabindex$="[[computeIconTabIndex_(narrow)]]"> 107 tabindex$="[[computeIconTabIndex_(narrow)]]">
87 </paper-icon-button> 108 </paper-icon-button>
88 <paper-input-container on-search="onSearchTermSearch" 109 <paper-input-container on-search="onSearchTermSearch"
89 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_" 110 on-keydown="onSearchTermKeydown" on-keypress="onSearchTermKeypress_"
90 no-label-float> 111 no-label-float>
91 <label id="prompt" for="searchInput">[[label]]</label> 112 <label id="prompt" for="searchInput">[[label]]</label>
92 <input is="iron-input" id="searchInput" type="search" 113 <input is="iron-input" id="searchInput" type="search"
93 on-blur="onInputBlur_" incremental></input> 114 on-blur="onInputBlur_" incremental></input>
94 </paper-input-container> 115 </paper-input-container>
95 <paper-icon-button icon="cr:cancel" id="clearSearch" 116 <paper-icon-button icon="cr:cancel" id="clearSearch"
96 title="[[clearLabel]]" hidden$="[[!hasSearchText]]" 117 title="[[clearLabel]]" hidden$="[[!hasSearchText]]"
97 on-tap="hideSearch_"> 118 on-tap="hideSearch_">
98 </paper-icon-button> 119 </paper-icon-button>
99 </template> 120 </template>
100 <script src="cr_toolbar_search_field.js"></script> 121 <script src="cr_toolbar_search_field.js"></script>
101 </dom-module> 122 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698