Kragrathea / OctoPrint-PrettyGCode

114 stars 22 forks source link

BUG: Duplication on webcam id #134

Open LazeMSS opened 2 years ago

LazeMSS commented 2 years ago

On this line https://github.com/Kragrathea/OctoPrint-PrettyGCode/blob/ccd36060959080d6dd1c67a19ead227c87bae70e/octoprint_prettygcode/static/js/prettygcode.js#L765

you are making a clone of the webcam div - but keeping the id webcam_rotator - this is not allowed. The DOM ID must be unique.

And easy fix could be to change the ID(s) of the clone and of course fixing the CSS assinged to the id (https://github.com/Kragrathea/OctoPrint-PrettyGCode/blob/ccd36060959080d6dd1c67a19ead227c87bae70e/octoprint_prettygcode/static/css/prettygcode.css#L116)

This causes problems for my plugin UI Customizer and also other code that expects the webcam_rotator to be a unique id

LazeMSS commented 2 years ago

It also looks like there is a call to the internal "_enableWebcam();" function - and its also stopped and started here: https://github.com/Kragrathea/OctoPrint-PrettyGCode/blob/ccd36060959080d6dd1c67a19ead227c87bae70e/octoprint_prettygcode/static/js/prettygcode.js#L809