summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/print_preview/new/destination_list.html
blob: 69416e0e6d403912a9e71ae8cf37b9719026d573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="../native_layer.html">
<link rel="import" href="../data/destination.html">
<link rel="import" href="destination_list_item.html">
<link rel="import" href="print_preview_shared_css.html">
<link rel="import" href="strings.html">
<link rel="import" href="throbber_css.html">

<dom-module id="print-preview-destination-list">
  <template>
    <style include="print-preview-shared action-link cr-hidden-style throbber">
      :host {
        display: block;
        user-select: none;
      }

      :host > header {
        -webkit-padding-end: 19px;
        -webkit-padding-start: 0;
        background-color: transparent;
        border-bottom: 1px solid #d2d2d2;
        padding-bottom: 8px;
      }

      :host :-webkit-any(.title, .action-link, .total) {
        -webkit-padding-end: 8px;
        -webkit-padding-start: 4px;
        display: inline;
        vertical-align: middle;
      }

      :host .throbber-container {
        -webkit-padding-end: 16px;
        -webkit-padding-start: 8px;
        display: inline-block;
        position: relative;
        vertical-align: middle;
      }

      :host .throbber {
        vertical-align: middle;
      }

      :host .no-destinations-message {
        -webkit-padding-start: 18px;
        color: #999;
        padding-bottom: 8px;
        padding-top: 8px;
      }

      :host .list-item {
        -webkit-padding-end: 2px;
        -webkit-padding-start: 18px;
        cursor: default;
        display: flex;
        padding-bottom: 3px;
        padding-top: 3px;
      }

      :not(.moving).list-item {
        transition: background-color 150ms;
      }

      .list-item:hover,
      .list-item:focus {
        background-color: rgb(228, 236, 247);
      }

      .list-item:focus {
        outline: none;
      }
    </style>
    <header>
      <h4 class="title">[[title]]</h4>
      <span class="total" hidden$="[[!showDestinationsTotal_]]">
        [[i18n('destinationCount', matchingDestinationsCount_)]]
      </span>
      <a is="action-link" class="action-link" hidden$="[[!hasActionLink]]"
          on-click="onActionLinkClick_">
        $i18n{manage}
      </a>
      <div class="throbber-container" hidden$="[[!loadingDestinations]]">
        <div class="throbber"></div>
      </div>
    </header>
    <template is="dom-repeat" items="[[destinations]]" notify-dom-change
        on-dom-change="updateIfNeeded_">
      <print-preview-destination-list-item class="list-item"
          search-query="[[searchQuery]]" destination="[[item]]"
          on-click="onDestinationSelected_">
      </print-preview-destination-list-item>
    </template>
    <div class="no-destinations-message" hidden$="[[hasDestinations_]]">
      $i18n{noDestinationsMessage}
    </div>
  </template>
  <script src="destination_list.js"></script>
</dom-module>