Further cleanup and removal of unnecessary functions. Pull some strings out for i18n.

This commit is contained in:
Sean Lip
2017-01-18 17:45:15 -08:00
parent d2bfd134b6
commit 59b074d19f
7 changed files with 27 additions and 64 deletions

View File

@@ -73,7 +73,7 @@ blocklyApp.WorkspaceBlockComponent = ng.core.Component({
directives: [blocklyApp.FieldSegmentComponent, ng.core.forwardRef(function() {
return blocklyApp.WorkspaceBlockComponent;
})],
inputs: ['block', 'level', 'tree', 'isTopLevel'],
inputs: ['block', 'level', 'tree'],
pipes: [blocklyApp.TranslatePipe]
})
.Class({
@@ -176,10 +176,10 @@ blocklyApp.WorkspaceBlockComponent = ng.core.Component({
// Angular change detection.)
var that = this;
setTimeout(function() {
if (that.tree && that.isTopLevel && !that.tree.id) {
that.tree.id = that.utilsService.generateUniqueId();
if (that.tree && that.level === 0 && !that.tree.id) {
that.tree.id = 'blockly-' + Blockly.utils.genUid();
}
if (that.tree && that.isTopLevel &&
if (that.tree && that.level === 0 &&
!that.treeService.getActiveDescId(that.tree.id)) {
that.treeService.setActiveDesc(that.idMap['blockRoot'], that.tree.id);
}
@@ -198,8 +198,7 @@ blocklyApp.WorkspaceBlockComponent = ng.core.Component({
}
},
generateAriaLabelledByAttr: function(mainLabel, secondLabel) {
return this.utilsService.generateAriaLabelledByAttr(
mainLabel, secondLabel);
return mainLabel + (secondLabel ? ' ' + secondLabel : '');
},
getBlockNeededLabel: function(blockInput) {
// The input type name, or 'any' if any official input type qualifies.