Replacing studyListContextMenu for dropdown
This commit is contained in:
1 parent
4daf7d8bf8
commit
485f82f64c
22 files changed
+250
-325
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
class Dropdown {
|
||||
constructor() {
|
||||
this.observer = new Tracker.Dependency();
|
||||
this._items = [];
|
||||
this.observer.changed();
|
||||
}
|
||||
|
||||
clearItems() {
|
||||
this._items = [];
|
||||
this.observer.changed();
|
||||
}
|
||||
|
||||
setItems(items) {
|
||||
this._items = items;
|
||||
this.observer.changed();
|
||||
}
|
||||
|
||||
addItem(item) {
|
||||
this._items.push(item);
|
||||
this.observer.changed();
|
||||
}
|
||||
|
||||
removeItem(item) {
|
||||
this._items = _.without(this._items, item);
|
||||
this.observer.changed();
|
||||
}
|
||||
|
||||
getItems() {
|
||||
this.observer.depend();
|
||||
return this._items;
|
||||
}
|
||||
}
|
||||
|
||||
OHIF.ui.Dropdown = Dropdown;
|
||||
Reference in new issue
Block a user