mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Add warning sounds when the user reaches a boundary of the workspace.
This commit is contained in:
@@ -556,6 +556,7 @@ blocklyApp.TreeService = ng.core.Class({
|
||||
if (this.getParentListElement_(activeDesc)) {
|
||||
statusMessage += ' Press left to go to parent list.';
|
||||
}
|
||||
this.audioService.playOopsSound();
|
||||
this.notificationsService.setStatusMessage(statusMessage);
|
||||
}
|
||||
} else if (e.keyCode == 39) {
|
||||
@@ -567,6 +568,7 @@ blocklyApp.TreeService = ng.core.Class({
|
||||
if (nextSibling) {
|
||||
this.setActiveDesc(nextSibling.id, treeId);
|
||||
} else {
|
||||
this.audioService.playOopsSound();
|
||||
this.notificationsService.setStatusMessage(
|
||||
'Reached bottom of list.');
|
||||
}
|
||||
@@ -582,6 +584,8 @@ blocklyApp.TreeService = ng.core.Class({
|
||||
var firstChild = this.getFirstChild(activeDesc);
|
||||
if (firstChild) {
|
||||
this.setActiveDesc(firstChild.id, treeId);
|
||||
} else {
|
||||
this.audioService.playOopsSound();
|
||||
}
|
||||
},
|
||||
moveUpOneLevel_: function(treeId) {
|
||||
@@ -589,6 +593,8 @@ blocklyApp.TreeService = ng.core.Class({
|
||||
var nextNode = this.getParentListElement_(activeDesc);
|
||||
if (nextNode) {
|
||||
this.setActiveDesc(nextNode.id, treeId);
|
||||
} else {
|
||||
this.audioService.playOopsSound();
|
||||
}
|
||||
},
|
||||
getParentListElement_: function(element) {
|
||||
|
||||
Reference in New Issue
Block a user