Skip to content

Commit 5a894aa

Browse files
jcheng5cpsievert
authored andcommitted
wip: Attempt to provide selection/filter handles with invokeChangeHandler method
1 parent 55c784c commit 5a894aa

File tree

8 files changed

+1913
-1628
lines changed

8 files changed

+1913
-1628
lines changed

inst/www/js/crosstalk.js

+25-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/js/crosstalk.js.map

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/js/crosstalk.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/js/crosstalk.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascript/src/filter.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class FilterHandle {
129129
* @param {Object} [extraInfo] - Extra properties to be included on the event
130130
* object that's passed to listeners (in addition to any options that were
131131
* passed into the `FilterHandle` constructor).
132-
*
132+
*
133133
* @fires FilterHandle#change
134134
*/
135135
clear(extraInfo) {
@@ -153,7 +153,7 @@ export class FilterHandle {
153153
* @param {Object} [extraInfo] - Extra properties to be included on the event
154154
* object that's passed to listeners (in addition to any options that were
155155
* passed into the `FilterHandle` constructor).
156-
*
156+
*
157157
* @fires FilterHandle#change
158158
*/
159159
set(keys, extraInfo) {
@@ -198,6 +198,14 @@ export class FilterHandle {
198198
return this._emitter.off(eventType, listener);
199199
}
200200

201+
invokeChangeHandler(extraInfo) {
202+
const evt = this._mergeExtraInfo(extraInfo);
203+
evt.value = this.filteredKeys;
204+
evt.oldValue = null;
205+
206+
this._emitter.trigger("change", evt, this);
207+
}
208+
201209
_onChange(extraInfo) {
202210
if (!this._filterSet)
203211
return;

javascript/src/selection.js

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ export class SelectionHandle {
158158
return this._emitter.off(eventType, listener);
159159
}
160160

161+
invokeChangeHandler(extraInfo) {
162+
const evt = this._mergeExtraInfo(extraInfo);
163+
evt.value = this.value;
164+
evt.oldValue = null;
165+
166+
this._emitter.trigger("change", evt, this);
167+
}
168+
161169
/**
162170
* Shuts down the `SelectionHandle` object.
163171
*

javascript/src/util.js

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export class SubscriptionTracker {
108108
return sub;
109109
}
110110

111+
trigger(eventType, arg, thisObj) {
112+
this._emitter.trigger(eventType, arg, thisObj);
113+
}
114+
111115
removeAllListeners() {
112116
let current_subs = this._subs;
113117
this._subs = {};

0 commit comments

Comments
 (0)