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
ad97f109
Commit
ad97f109
authored
Sep 06, 2019
by
Evan W. Patton
Committed by
Susan Rati Lane
Sep 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make blocks collapse/expand on double click (#1809)
Change-Id: Ia4964537d457316824325bdf351a26820a51144a
parent
1f5abd5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
appinventor/blocklyeditor/src/workspace_svg.js
appinventor/blocklyeditor/src/workspace_svg.js
+20
-0
No files found.
appinventor/blocklyeditor/src/workspace_svg.js
View file @
ad97f109
...
...
@@ -1064,6 +1064,26 @@ Blockly.WorkspaceSvg.prototype.fireChangeListener = function(event) {
oldParent
&&
this
.
requestErrorChecking
(
oldParent
);
block
&&
this
.
requestErrorChecking
(
block
);
}
// Double-click to collapse/expand blocks
if
(
event
instanceof
Blockly
.
Events
.
Ui
&&
event
.
element
===
'
click
'
)
{
if
(
this
.
doubleClickPid_
)
{
clearTimeout
(
this
.
doubleClickPid_
);
this
.
doubleClickPid_
=
undefined
;
if
(
event
.
blockId
===
this
.
doubleClickBlock_
)
{
// double click
var
block
=
this
.
getBlockById
(
this
.
doubleClickBlock_
);
block
.
setCollapsed
(
!
block
.
isCollapsed
());
return
;
}
}
if
(
!
this
.
doubleClickPid_
)
{
this
.
doubleClickBlock_
=
event
.
blockId
;
this
.
doubleClickPid_
=
setTimeout
(
function
()
{
this
.
doubleClickPid_
=
undefined
;
}.
bind
(
this
),
500
);
// windows uses 500ms as the default speed; seems reasonable enough
}
}
};
/**
...
...
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