Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
47628a85
Unverified
Commit
47628a85
authored
Mar 02, 2020
by
Beka Westberg
Committed by
GitHub
Mar 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix number block displaying non-number values (#2073)
parent
90c6d5e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
appinventor/blocklyeditor/ploverConfig.js
appinventor/blocklyeditor/ploverConfig.js
+1
-0
appinventor/blocklyeditor/src/field.js
appinventor/blocklyeditor/src/field.js
+35
-0
No files found.
appinventor/blocklyeditor/ploverConfig.js
View file @
47628a85
...
@@ -143,6 +143,7 @@
...
@@ -143,6 +143,7 @@
"
./src/language_switch.js
"
,
"
./src/language_switch.js
"
,
"
./src/warning.js
"
,
"
./src/warning.js
"
,
"
./src/toolboxController.js
"
,
"
./src/toolboxController.js
"
,
"
./src/field.js
"
,
// Dialog Utiltiy
// Dialog Utiltiy
"
./src/util.js
"
,
"
./src/util.js
"
,
...
...
appinventor/blocklyeditor/src/field.js
0 → 100644
View file @
47628a85
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright © 2016 Massachusetts Institute of Technology. All rights reserved.
/**
* @license
* @fileoverview Visual blocks editor for MIT App Inventor
* Add additional "class methods" to Blockly.Field
*/
'
use strict
'
;
goog
.
provide
(
'
AI.Blockly.Field
'
);
goog
.
require
(
'
Blockly.Field
'
);
/**
* Sets the value of the field. Since AI runs an older version of blockly,
* the newValue should always be a string.
*
* This is overridden so that the field correctly updates the display text
* even if the newValue is the same as the old value.
* @param {string} newValue The new value.
*/
Blockly
.
Field
.
prototype
.
setValue
=
function
(
newValue
)
{
if
(
newValue
===
null
)
{
return
null
;
// No change if null;
}
var
oldValue
=
this
.
getValue
();
// Must get value before setting text.
this
.
setText
(
newValue
);
// Always update text. See #1238.
if
(
this
.
sourceBlock_
&&
Blockly
.
Events
.
isEnabled
()
&&
newValue
!=
oldValue
)
{
Blockly
.
Events
.
fire
(
new
Blockly
.
Events
.
Change
(
this
.
sourceBlock_
,
'
field
'
,
this
.
name
,
oldValue
,
newValue
));
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment