Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
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
ardublockly
Commits
4dffad0d
Commit
4dffad0d
authored
Oct 12, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve 'clean up' spacing.
parent
879cacbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
core/toolbox.js
core/toolbox.js
+7
-6
core/workspace_svg.js
core/workspace_svg.js
+2
-2
No files found.
core/toolbox.js
View file @
4dffad0d
...
@@ -66,8 +66,8 @@ Blockly.Toolbox.prototype.width = 0;
...
@@ -66,8 +66,8 @@ Blockly.Toolbox.prototype.width = 0;
Blockly
.
Toolbox
.
prototype
.
selectedOption_
=
null
;
Blockly
.
Toolbox
.
prototype
.
selectedOption_
=
null
;
/**
/**
* The
SVG group curr
ently selected.
* The
tree node most rec
ently selected.
* @type {
*
}
* @type {
goog.ui.tree.BaseNode
}
* @private
* @private
*/
*/
Blockly
.
Toolbox
.
prototype
.
lastCategory_
=
null
;
Blockly
.
Toolbox
.
prototype
.
lastCategory_
=
null
;
...
@@ -99,7 +99,7 @@ Blockly.Toolbox.prototype.init = function() {
...
@@ -99,7 +99,7 @@ Blockly.Toolbox.prototype.init = function() {
// Create an HTML container for the Toolbox menu.
// Create an HTML container for the Toolbox menu.
this
.
HtmlDiv
=
goog
.
dom
.
createDom
(
'
div
'
,
'
blocklyToolboxDiv
'
);
this
.
HtmlDiv
=
goog
.
dom
.
createDom
(
'
div
'
,
'
blocklyToolboxDiv
'
);
this
.
HtmlDiv
.
setAttribute
(
'
dir
'
,
this
.
workspace_
.
RTL
?
'
RTL
'
:
'
LTR
'
);
this
.
HtmlDiv
.
setAttribute
(
'
dir
'
,
workspace
.
RTL
?
'
RTL
'
:
'
LTR
'
);
document
.
body
.
appendChild
(
this
.
HtmlDiv
);
document
.
body
.
appendChild
(
this
.
HtmlDiv
);
// Clicking on toolbar closes popups.
// Clicking on toolbar closes popups.
...
@@ -128,7 +128,7 @@ Blockly.Toolbox.prototype.init = function() {
...
@@ -128,7 +128,7 @@ Blockly.Toolbox.prototype.init = function() {
this
.
CONFIG_
[
'
cleardotPath
'
]
=
workspace
.
options
.
pathToMedia
+
'
1x1.gif
'
;
this
.
CONFIG_
[
'
cleardotPath
'
]
=
workspace
.
options
.
pathToMedia
+
'
1x1.gif
'
;
this
.
CONFIG_
[
'
cssCollapsedFolderIcon
'
]
=
this
.
CONFIG_
[
'
cssCollapsedFolderIcon
'
]
=
'
blocklyTreeIconClosed
'
+
(
this
.
workspace_
.
RTL
?
'
Rtl
'
:
'
Ltr
'
);
'
blocklyTreeIconClosed
'
+
(
workspace
.
RTL
?
'
Rtl
'
:
'
Ltr
'
);
var
tree
=
new
Blockly
.
Toolbox
.
TreeControl
(
this
,
this
.
CONFIG_
);
var
tree
=
new
Blockly
.
Toolbox
.
TreeControl
(
this
,
this
.
CONFIG_
);
this
.
tree_
=
tree
;
this
.
tree_
=
tree
;
tree
.
setShowRootNode
(
false
);
tree
.
setShowRootNode
(
false
);
...
@@ -148,6 +148,7 @@ Blockly.Toolbox.prototype.dispose = function() {
...
@@ -148,6 +148,7 @@ Blockly.Toolbox.prototype.dispose = function() {
this
.
tree_
.
dispose
();
this
.
tree_
.
dispose
();
goog
.
dom
.
removeNode
(
this
.
HtmlDiv
);
goog
.
dom
.
removeNode
(
this
.
HtmlDiv
);
this
.
workspace_
=
null
;
this
.
workspace_
=
null
;
this
.
lastCategory_
=
null
;
};
};
/**
/**
...
@@ -332,9 +333,9 @@ Blockly.Toolbox.TreeControl.prototype.setSelectedItem = function(node) {
...
@@ -332,9 +333,9 @@ Blockly.Toolbox.TreeControl.prototype.setSelectedItem = function(node) {
if
(
node
&&
node
.
blocks
&&
node
.
blocks
.
length
)
{
if
(
node
&&
node
.
blocks
&&
node
.
blocks
.
length
)
{
toolbox
.
flyout_
.
show
(
node
.
blocks
);
toolbox
.
flyout_
.
show
(
node
.
blocks
);
// Scroll the flyout to the top if the category has changed.
// Scroll the flyout to the top if the category has changed.
if
(
toolbox
.
lastCategory_
!=
node
.
blocks
)
{
if
(
toolbox
.
lastCategory_
!=
node
)
{
toolbox
.
flyout_
.
scrollToTop
();
toolbox
.
flyout_
.
scrollToTop
();
toolbox
.
lastCategory_
=
node
.
blocks
;
toolbox
.
lastCategory_
=
node
;
}
}
}
else
{
}
else
{
// Hide the flyout.
// Hide the flyout.
...
...
core/workspace_svg.js
View file @
4dffad0d
...
@@ -658,9 +658,9 @@ Blockly.WorkspaceSvg.prototype.cleanUp_ = function() {
...
@@ -658,9 +658,9 @@ Blockly.WorkspaceSvg.prototype.cleanUp_ = function() {
for
(
var
i
=
0
,
block
;
block
=
topBlocks
[
i
];
i
++
)
{
for
(
var
i
=
0
,
block
;
block
=
topBlocks
[
i
];
i
++
)
{
var
xy
=
block
.
getRelativeToSurfaceXY
();
var
xy
=
block
.
getRelativeToSurfaceXY
();
block
.
moveBy
(
-
xy
.
x
,
cursorY
-
xy
.
y
);
block
.
moveBy
(
-
xy
.
x
,
cursorY
-
xy
.
y
);
cursorY
+=
block
.
getHeightWidth
().
height
;
cursorY
+=
Blockly
.
BlockSvg
.
MIN_BLOCK_Y
;
block
.
snapToGrid
();
block
.
snapToGrid
();
cursorY
=
block
.
getRelativeToSurfaceXY
().
y
+
block
.
getHeightWidth
().
height
+
Blockly
.
BlockSvg
.
MIN_BLOCK_Y
;
}
}
// Fire an event to allow scrollbars to resize.
// Fire an event to allow scrollbars to resize.
Blockly
.
fireUiEvent
(
window
,
'
resize
'
);
Blockly
.
fireUiEvent
(
window
,
'
resize
'
);
...
...
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