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

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
McSam authored and McSam committed Jul 16, 2019
1 parent debc4a4 commit d146606
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/scratch/blocks/Math/math_number_positive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
import { translate } from '../../../utils/lang/i18n';

Blockly.Blocks.math_number_positive = {
init: Blockly.Blocks.math_number.init,
definition(){
return {
message0: '%1',
args0 : [
{
type : 'field_number',
name : 'NUM',
value: 0,
},
],
output : 'Number',
outputShape : Blockly.OUTPUT_SHAPE_ROUND,
colour : '#dedede',
colourSecondary: '#ffffff',
colourTertiary : '#ffffff',
tooltip : translate('Math Number Tooltip'),
category : 'mathematical',
};
},
meta() {
return {
'display_name': translate('Math Number Positive'),
'description' : translate('Math Number Description'),
};
},
numberValidator(input) {
if (/^([0][,.]|[1-9]+[,.])?([0]|[1-9])*$/.test(input)) {
return undefined;
Expand Down

0 comments on commit d146606

Please sign in to comment.