Skip to content

Instantly share code, notes, and snippets.

@tenbits
Created June 21, 2017 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenbits/da828f7a820d871805f03c6d89a0a789 to your computer and use it in GitHub Desktop.
Save tenbits/da828f7a820d871805f03c6d89a0a789 to your computer and use it in GitHub Desktop.
Components Bin
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