-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlive-localizer.js
52 lines (46 loc) · 1.56 KB
/
live-localizer.js
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
/**
@license https://github.com/t2ym/live-localizer/blob/master/LICENSE.md
Copyright (c) 2016, Tetsuya Mori <[email protected]>. All rights reserved.
*/
/**
## Static Loader for `<live-localier-main>`
@group I18nBehavior
@element live-localizer
@demo demo/index.html
*/
/*
FIXME(polymer-modulizer): the above comments were extracted
from HTML and may be out of place here. Review them and
then delete this comment!
*/
import '@polymer/polymer/polymer-legacy.js';
import './live-localizer-main.js';
import { Polymer as Polymer$0 } from '@polymer/polymer/lib/legacy/polymer-fn.js';
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js';
Polymer$0({
importMeta: import.meta,
_template: html`
<live-localizer-main>
<slot slot="storage-cloud" name="storage-cloud"></slot>
<slot slot="storage-browser" name="storage-browser"></slot>
<slot slot="storage-device" name="storage-device"></slot>
</live-localizer-main>
`,
is: 'live-localizer',
/**
* Created callback
*
* Supply slot attributes for source-level compatibility with non-hybrid live-localizer
*/
created: function () {
var self = this;
[ 'cloud', 'browser', 'device' ].forEach(function (storageType) {
Array.prototype.forEach.call(dom(self).querySelectorAll('.storage.' + storageType) || [], function (cloudStorageElement) {
if (!cloudStorageElement.getAttribute('slot')) {
cloudStorageElement.setAttribute('slot', 'storage-' + storageType);
}
});
});
}
});