-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdropdown-menu.html
46 lines (42 loc) · 1.46 KB
/
dropdown-menu.html
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
<link href="bower_components/polymer/polymer.html" rel="import">
<link rel="import"
href="bower_components/paper-dropdown/paper-dropdown.html">
<link rel="import"
href="bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import"
href="bower_components/core-menu/core-menu.html">
<link rel="import"
href="bower_components/paper-item/paper-item.html">
<polymer-element name="dropdown-menu" constructor="" attributes="dataModel label">
<template>
<paper-dropdown-menu id="menu" label="{{label}}" disabled="true">
<paper-dropdown class="dropdown">
<core-menu class="menu">
<template repeat="{{processlist}}">
<paper-item>{{}}</paper-item>
</template>
</core-menu>
</paper-dropdown>
</paper-dropdown-menu>
</template>
<script>
Polymer({
publish: {
dataModel: 'temp',
label: 'label'
},
domReady: function () {
this.processlist = [];
},
onInvoke: function () {
$.getScript('rest-api.js', getApiData(this.dataModel, this));
},
disable: function () {
$('#menu')[0].disabled = true;
},
enable: function () {
$('#menu')[0].disabled = false;
}
});
</script>
</polymer-element>