• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!--
2  -- Copyright 2013 The Chromium Authors. All rights reserved.
3  -- Use of this source code is governed by a BSD-style license that can be
4  -- found in the LICENSE file.
5  -->
6
7<polymer-element name="kb-key-import" attributes="importId">
8  <template>
9    <style>
10      :host {
11        display: none;
12      }
13    </style>
14  </template>
15  <script>
16    Polymer('kb-key-import', {
17      /**
18      * The id of the document fragment that will be imported.
19       */
20      importId: null,
21
22      /**
23       * Import content from a document fragment.
24       * @param {!DocumentFragment} content Document fragment that contains
25       *     the content to import.
26       */
27      importDoc: function(content) {
28        var id = this.getAttribute('importId');
29        var fragment = content.querySelector('#' + id);
30        return fragment && fragment.content ? fragment.content : fragment;
31      }
32    });
33  </script>
34</polymer-element>
35