mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Distinguish category labels from other labels
This commit is contained in:
parent
68e7f5ee31
commit
3f9798e0f3
2 changed files with 11 additions and 2 deletions
|
@ -73,6 +73,13 @@ Blockly.FlyoutButton = function(workspace, targetWorkspace, xml, isLabel) {
|
|||
*/
|
||||
this.isLabel_ = isLabel;
|
||||
|
||||
/**
|
||||
* Whether this button is a label at the top of a category.
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.isCategoryLabel_ = xml.getAttribute('category-label') === 'true';
|
||||
|
||||
/**
|
||||
* Function to call when this button is clicked.
|
||||
* @type {function(!Blockly.FlyoutButton)}
|
||||
|
|
|
@ -192,8 +192,10 @@ Blockly.Toolbox.prototype.showAll = function() {
|
|||
var category = this.categoryMenu_.categories_[i];
|
||||
|
||||
// create a label node to go at the top of the category
|
||||
var labelString = '<xml><label text="' + category.name_ +
|
||||
'" web-class="categoryLabel"></label></xml>';
|
||||
var labelString = '<xml><label text="' + category.name_ + '"' +
|
||||
' category-label="true"' +
|
||||
' web-class="categoryLabel">' +
|
||||
'</label></xml>';
|
||||
var labelXML = Blockly.Xml.textToDom(labelString);
|
||||
allContents.push(labelXML.firstChild);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue