Skip to content

Commit c9fba52

Browse files
authored
Fixing event leak (#247)
1 parent d3e4edd commit c9fba52

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

src/simulator/src/ux.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -249,35 +249,23 @@ export function objectPropertyAttributeCheckedUpdate() {
249249
}
250250

251251
export function checkPropertiesUpdate(value = 0) {
252-
// console.log('update check')
253-
252+
$('.objectPropertyAttribute').off(
253+
'change keyup paste click',
254+
objectPropertyAttributeUpdate
255+
)
254256
$('.objectPropertyAttribute').on(
255257
'change keyup paste click',
256258
objectPropertyAttributeUpdate
257259
)
258260

261+
$('.objectPropertyAttributeChecked').off(
262+
'change keyup paste click',
263+
objectPropertyAttributeCheckedUpdate
264+
)
259265
$('.objectPropertyAttributeChecked').on(
260266
'change keyup paste click',
261267
objectPropertyAttributeCheckedUpdate
262268
)
263-
264-
//Duplicate of above (Handled above)
265-
// $('.objectPropertyAttributeChecked').on('click', function () {
266-
// if (this.name !== 'toggleLabelInLayoutMode') return // Hack to prevent toggleLabelInLayoutMode from toggling twice
267-
// scheduleUpdate()
268-
// updateCanvasSet(true)
269-
// wireToBeCheckedSet(1)
270-
// if (
271-
// simulationArea.lastSelected &&
272-
// simulationArea.lastSelected[this.name]
273-
// ) {
274-
// simulationArea.lastSelected[this.name](this.value)
275-
// // Commented out due to property menu refresh bug
276-
// // prevPropertyObjSet(simulationArea.lastSelected[this.name](this.value)) || prevPropertyObjGet();
277-
// } else {
278-
// circuitProperty[this.name](this.checked)
279-
// }
280-
// })
281269
}
282270

283271
/**

0 commit comments

Comments
 (0)