Add the ability to make a read-only workspace writable
See original GitHub issueIs your feature request related to a problem? Please describe.
I need to be able to have a workspace start out as read-only, but become writable.
Describe the solution you’d like
For maximum flexibility, I’d love to see a workspace.setReadOnly(boolean)
function, but if it’s easier to only support going from read-only to writable, a function workspace.enableEditing()
would suffice.
Describe alternatives you’ve considered
I found this message from Neil on Google Groups, which suggests putting a transparent div over Blockly to prevent interactions. The problem with this is that it also disables panning and zooming around the Blockly workspace. I want users to be able to interact with, but not edit, the workspace.
Additional context
In that message, Neil said this:
Readonly cannot be changed after init. There are too many event handlers that would need to be added and removed.
I don’t understand why that would be an unsolvable problem (maybe I’m just not familiar enough with the Blockly source). I’d like to try to implement this change myself, so I’d appreciate any additional context or guidance that anyone (@NeilFraser) can give me.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@BeksOmega Thanks so much, it’s working great now! This can be closed if desired.
Oh there’s an actual dispose method! Nice! I’ll have to try that out, thank you.