mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
Migrate hideChaff() from Blockly to WorkspaceSvg (#5460)
* Add hideChaff() to core/workspace_svg.js * Mark Blockly.hideChaff as deprecated * Update uses of Blockly.hideChaff() to WorkspaceSvg.hideChaff() in core * Update uses of Blockly.hideChaff() to WorkspaceSvg.hideChaff() in demos * Style and formatting fixes * Switch from accessor to stub wrapper for Blockly.hideChaff Co-authored-by: Christopher Allen <cpcallen+github@gmail.com> Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
This commit is contained in:
@@ -631,7 +631,7 @@ AppController.prototype.confirmLeavePage = function(e) {
|
||||
* @param {string} id ID of element to show.
|
||||
*/
|
||||
AppController.prototype.openModal = function(id) {
|
||||
Blockly.hideChaff();
|
||||
Blockly.common.getMainWorkspace().hideChaff();
|
||||
this.modalName_ = id;
|
||||
document.getElementById(id).style.display = 'block';
|
||||
document.getElementById('modalShadow').style.display = 'block';
|
||||
|
||||
@@ -88,7 +88,7 @@ BlockFactory.formatChange = function() {
|
||||
var languageTA = document.getElementById('languageTA');
|
||||
if (document.getElementById('format').value == 'Manual-JSON' ||
|
||||
document.getElementById('format').value == 'Manual-JS') {
|
||||
Blockly.hideChaff();
|
||||
Blockly.common.getMainWorkspace().hideChaff();
|
||||
mask.style.display = 'block';
|
||||
languagePre.style.display = 'none';
|
||||
languageTA.style.display = 'block';
|
||||
|
||||
@@ -35,7 +35,7 @@ function formatChange() {
|
||||
var languagePre = document.getElementById('languagePre');
|
||||
var languageTA = document.getElementById('languageTA');
|
||||
if (document.getElementById('format').value == 'Manual') {
|
||||
Blockly.hideChaff();
|
||||
Blockly.common.getMainWorkspace().hideChaff();
|
||||
mask.style.display = 'block';
|
||||
languagePre.style.display = 'none';
|
||||
languageTA.style.display = 'block';
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
}
|
||||
|
||||
function toggleEditable() {
|
||||
Blockly.hideChaff();
|
||||
workspace.hideChaff();
|
||||
var blocks = workspace.getAllBlocks(false);
|
||||
for(var i = 0, block; block = blocks[i]; i++) {
|
||||
block.setEditable(!block.isEditable());
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
|
||||
function toggleCollapsed() {
|
||||
Blockly.hideChaff();
|
||||
workspace.hideChaff();
|
||||
var blocks = workspace.getAllBlocks(false);
|
||||
for(var i = 0, block; block = blocks[i]; i++) {
|
||||
block.setCollapsed(!block.isCollapsed());
|
||||
|
||||
Reference in New Issue
Block a user