Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit d146606

Browse files
McSamMcSam
authored andcommitted
fix bug
1 parent debc4a4 commit d146606

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/scratch/blocks/Math/math_number_positive.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
import { translate } from '../../../utils/lang/i18n';
2+
13
Blockly.Blocks.math_number_positive = {
24
init: Blockly.Blocks.math_number.init,
5+
definition(){
6+
return {
7+
message0: '%1',
8+
args0 : [
9+
{
10+
type : 'field_number',
11+
name : 'NUM',
12+
value: 0,
13+
},
14+
],
15+
output : 'Number',
16+
outputShape : Blockly.OUTPUT_SHAPE_ROUND,
17+
colour : '#dedede',
18+
colourSecondary: '#ffffff',
19+
colourTertiary : '#ffffff',
20+
tooltip : translate('Math Number Tooltip'),
21+
category : 'mathematical',
22+
};
23+
},
24+
meta() {
25+
return {
26+
'display_name': translate('Math Number Positive'),
27+
'description' : translate('Math Number Description'),
28+
};
29+
},
330
numberValidator(input) {
431
if (/^([0][,.]|[1-9]+[,.])?([0]|[1-9])*$/.test(input)) {
532
return undefined;

0 commit comments

Comments
 (0)