Created
June 21, 2017 09:58
-
-
Save tenbits/da828f7a820d871805f03c6d89a0a789 to your computer and use it in GitHub Desktop.
Components Bin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '/bower_components/spectrum/spectrum.css'; | |
import '/bower_components/spectrum/spectrum.js'; | |
define ColorPickButton { | |
slot domInsert () { | |
this.$.find('.color-picker').spectrum({ | |
cancelText: 'Abbrechen', | |
chooseText: 'Auswählen', | |
allowEmpty: true, | |
showAlpha: true, | |
showPalette: true, | |
showSelectionPalette: true, | |
color: null, | |
move: this.emit, | |
hide: this.emit | |
}); | |
} | |
slot private showColorPicker () { | |
this.$.find('.color-picker').spectrum('show'); | |
} | |
function self emit (tinyColor) { | |
Compo.pipe('toolbar').emit('backgroundColor', tinyColor && tinyColor.toRgbString() || null); | |
} | |
.toolbar-button x-tap='showColorPicker' { | |
i.material-icons > 'color_lens' | |
span .is-text-optional > ' Hintergrund ' | |
input .color-picker; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment