Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
67513d6c
Commit
67513d6c
authored
Jun 05, 2014
by
Romain Courteaud
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up page modification.
If possible, do not use innerHTML.
parent
dff6f358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
dream/platform/src2/dream/index.js
dream/platform/src2/dream/index.js
+12
-7
No files found.
dream/platform/src2/dream/index.js
View file @
67513d6c
...
...
@@ -165,8 +165,6 @@
return
gadget
.
aq_pleasePublishMyState
({
page
:
"
document_list
"
})
.
push
(
gadget
.
pleaseRedirectMyHash
.
bind
(
gadget
));
}
// Clear the previous rendering
element
.
innerHTML
=
""
;
return
gadget
.
declareGadget
(
options
.
page
+
"
.html
"
)
.
push
(
function
(
g
)
{
page_gadget
=
g
;
...
...
@@ -191,17 +189,24 @@
gadget
.
props
.
element
.
querySelector
(
"
header h1
"
).
textContent
=
title
;
// Append in the DOM at the end to reduce flickering and reduce DOM
// modifications
element
.
appendChild
(
page_element
);
while
(
panel
.
firstChild
)
{
panel
.
removeChild
(
panel
.
firstChild
);
}
panel
.
innerHTML
=
navigation_template
({
navigationlist
:
navigation_list
});
// XXX JQuery mobile
$
(
element
).
trigger
(
'
create
'
);
$
(
panel
).
trigger
(
"
create
"
);
// Append in the DOM at the end to reduce flickering and reduce DOM
// modifications
// Clear the previous rendering
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
}
element
.
appendChild
(
page_element
);
$
(
element
).
trigger
(
'
create
'
);
// XXX RenderJS hack to start sub gadget services
// Only work if this gadget has no parent.
if
(
page_gadget
.
startService
!==
undefined
)
{
...
...
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