mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
feat: Add support for toggling readonly mode. (#8750)
* feat: Add methods for toggling and inspecting the readonly state of a workspace. * refactor: Use the new readonly setters/getters in place of checking the injection options. * fix: Fix bug that allowed dragging blocks from a flyout onto a readonly workspace. * feat: Toggle a `blocklyReadOnly` class when readonly status is changed. * chore: Placate the linter. * chore: Placate the compiler.
This commit is contained in:
@@ -42,7 +42,7 @@ suite('Key Down', function () {
|
||||
function runReadOnlyTest(keyEvent, opt_name) {
|
||||
const name = opt_name ? opt_name : 'Not called when readOnly is true';
|
||||
test(name, function () {
|
||||
this.workspace.options.readOnly = true;
|
||||
this.workspace.setIsReadOnly(true);
|
||||
this.injectionDiv.dispatchEvent(keyEvent);
|
||||
sinon.assert.notCalled(this.hideChaffSpy);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user