mirror of
https://github.com/documize/community.git
synced 2025-07-25 08:09:43 +02:00
content linker styled using standard list picker control
This commit is contained in:
parent
db1b3aef8c
commit
23a6b25b0a
5 changed files with 72 additions and 61 deletions
|
@ -12,6 +12,7 @@
|
|||
import { debounce } from '@ember/runloop';
|
||||
import { computed, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { A } from '@ember/array';
|
||||
import Component from '@ember/component';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue