-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhue-input.html
More file actions
executable file
·60 lines (52 loc) · 1.64 KB
/
hue-input.html
File metadata and controls
executable file
·60 lines (52 loc) · 1.64 KB
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
<!DOCTYPE html>
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-icons/iconsets/image-icons.html">
<link href="hue-dialog.html" rel="import">
<polymer-element name="hue-input" attributes="opened transition width height">
<template>
<style>
#preview::shadow core-icon {
border-radius: 3px;
border-width: 2px;
border-style: solid;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
</style>
<template if="{{value}}">
<paper-icon-button on-tap="{{open}}" iconSrc="{{value}}" id="preview"></paper-icon-button>
</template>
<template if="{{!value}}">
<paper-icon-button on-tap="{{open}}" icon="image:photo"></paper-icon-button>
</template>
<hue-dialog id="dialog" opened="{{opened}}" value={{value}} width="{{width}}" height="{{height}}"></hue-dialog>
</template>
<script>
Polymer('hue-input', {
/**
* Set opened to true to show the dialog and to false to hide it.
* A dialog may be made intially opened by setting its opened attribute.
* @attribute opened
* @type boolean
* @default false
*/
opened: false,
/**
* Set this property to the id of a <core-transition> element to specify
* the transition to use when opening/closing this dialog.
*
* @attribute transition
* @type string
* @default ''
*/
transition: '',
width: 300,
height: 300,
value: '',
open: function(){
this.opened = !this.opened;
}
});
</script>
</polymer-element>