Skip to content

Commit fe16249

Browse files
committed
extended selection
1 parent 8fadf7e commit fe16249

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/js/panel._utils.js

+32
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,30 @@ window.Widgets.Panel.Utils = {};
165165
// },
166166
// ];
167167

168+
// setup the left click capability
169+
ns.selectArray = [];
170+
ns.leftclick = function(event, d) {
171+
let len = ns.selectArray.length;
172+
console.log(`clicked on: ${d}`);
173+
const selected = d3.select(this); // can't use arrow scoping
174+
if (event.ctrlKey) {
175+
// we will do a multi-select
176+
if (len < 2) {
177+
// we add the data element to the array
178+
ns.selectArray.push(d);
179+
// highlight the node
180+
selected.style("stroke", ns.theme.select);
181+
selected.style("stroke-width", 5);
182+
} else if (len === 2) {
183+
// we first need to select the first object in the list
168184

185+
}
186+
187+
} else {
188+
// we will do a single select
189+
}
190+
191+
}
169192

170193

171194

@@ -419,6 +442,15 @@ window.Widgets.Panel.Utils = {};
419442
ns.split.promo_IDs = [];
420443
ns.split.promo_annotate_list = [];
421444

445+
// Setup the local theme
446+
if (!ns.theme) {
447+
if (ns.options.theme === 'light') {
448+
ns.theme = ns.options.light_theme
449+
} else {
450+
ns.theme = ns.options.dark_theme
451+
}
452+
}
453+
422454
// If Incident Management, then check for these promotoables
423455
ns.split.prom_types = [
424456
'incident',

src/js/panel.promo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ window.Widgets.Panel.Promo = {}
131131
// for promo
132132
ns.promoNode = ns.promo_svg_root
133133
.append('g')
134-
.selectAll('pnodes')
134+
.selectAll('.pnodes')
135135
.data(panelUtilsNs.split.promo.nodes)
136136
.join('image')
137137
.attr('class', 'pnodes')

0 commit comments

Comments
 (0)