1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

content linker styled using standard list picker control

This commit is contained in:
Harvey Kandola 2017-12-07 20:47:26 +00:00
parent db1b3aef8c
commit 23a6b25b0a
5 changed files with 72 additions and 61 deletions

View file

@ -18,6 +18,7 @@ export default Component.extend({
singleSelect: false,
items: [],
maxHeight: 0,
onSelect: null,
styleCss: computed('maxHeight', function () {
let height = this.get('maxHeight');
@ -30,6 +31,15 @@ export default Component.extend({
actions: {
onToggle(item) {
// callback takes precedence
// caller sets item to 'selected'
let cb = this.get('onSelect');
if (cb !== null) {
this.attrs.onSelect(item);
return;
}
// no callback, we mark item as selected
if (this.get('singleSelect')) {
let items = this.get('items');
items.forEach(item => {