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
0c3dad0e
Commit
0c3dad0e
authored
Sep 14, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resize Code demo before injection to eliminate loading reflow.
parent
3f8e586f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
demos/code/code.js
demos/code/code.js
+2
-3
No files found.
demos/code/code.js
View file @
0c3dad0e
...
@@ -365,12 +365,13 @@ Code.init = function() {
...
@@ -365,12 +365,13 @@ Code.init = function() {
el
.
style
.
width
=
(
2
*
bBox
.
width
-
el
.
offsetWidth
)
+
'
px
'
;
el
.
style
.
width
=
(
2
*
bBox
.
width
-
el
.
offsetWidth
)
+
'
px
'
;
}
}
// Make the 'Blocks' tab line up with the toolbox.
// Make the 'Blocks' tab line up with the toolbox.
if
(
Code
.
workspace
.
toolbox_
.
width
)
{
if
(
Code
.
workspace
&&
Code
.
workspace
.
toolbox_
.
width
)
{
document
.
getElementById
(
'
tab_blocks
'
).
style
.
minWidth
=
document
.
getElementById
(
'
tab_blocks
'
).
style
.
minWidth
=
(
Code
.
workspace
.
toolbox_
.
width
-
38
)
+
'
px
'
;
(
Code
.
workspace
.
toolbox_
.
width
-
38
)
+
'
px
'
;
// Account for the 19 pixel margin and on each side.
// Account for the 19 pixel margin and on each side.
}
}
};
};
onresize
();
window
.
addEventListener
(
'
resize
'
,
onresize
,
false
);
window
.
addEventListener
(
'
resize
'
,
onresize
,
false
);
var
toolbox
=
document
.
getElementById
(
'
toolbox
'
);
var
toolbox
=
document
.
getElementById
(
'
toolbox
'
);
...
@@ -398,7 +399,6 @@ Code.init = function() {
...
@@ -398,7 +399,6 @@ Code.init = function() {
}
}
Code
.
tabClick
(
Code
.
selected
);
Code
.
tabClick
(
Code
.
selected
);
Blockly
.
fireUiEvent
(
window
,
'
resize
'
);
Code
.
bindClick
(
'
trashButton
'
,
Code
.
bindClick
(
'
trashButton
'
,
function
()
{
Code
.
discard
();
Code
.
renderContent
();});
function
()
{
Code
.
discard
();
Code
.
renderContent
();});
...
@@ -422,7 +422,6 @@ Code.init = function() {
...
@@ -422,7 +422,6 @@ Code.init = function() {
function
(
name_
)
{
return
function
()
{
Code
.
tabClick
(
name_
);};}(
name
));
function
(
name_
)
{
return
function
()
{
Code
.
tabClick
(
name_
);};}(
name
));
}
}
onresize
();
// Lazy-load the syntax-highlighting.
// Lazy-load the syntax-highlighting.
window
.
setTimeout
(
Code
.
importPrettify
,
1
);
window
.
setTimeout
(
Code
.
importPrettify
,
1
);
};
};
...
...
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