Skip to content
Browse files

Merge pull request #2399 from ajaxorg/ace_paint_perf

[Liskov] Ace paint perf
  • Loading branch information...
2 parents d3c5d94 + a1cdcf1 commit c251f2dca10a5aab3c9d322d6cb0cffe0cdd7572 Mostafa Eweda committed
View
9 plugins-client/ext.code/code.js
@@ -844,7 +844,7 @@ module.exports = ext.register("ext/code/code", {
});
// display feedback while loading files
- var isOpen, bgMessage;
+ var isOpen, bgMessage, animationEndTimeout;
var checkLoading = function(e) {
if (!ceEditor.xmlRoot)
return;
@@ -856,7 +856,7 @@ module.exports = ext.register("ext/code/code", {
bgMessage = bgMessage|| document.createElement("div");
container.parentNode.appendChild(bgMessage);
}
- var isDark = container.className.indexOf("ace_dark")!=-1;
+ var isDark = container.className.indexOf("ace_dark") != -1;
bgMessage.className = "ace_smooth_loading" + (isDark ? " ace_dark" : "");
bgMessage.textContent = "Loading " + ceEditor.xmlRoot.getAttribute("name");
@@ -865,10 +865,15 @@ module.exports = ext.register("ext/code/code", {
container.style.pointerEvents = "none";
container.style.opacity = 0;
isOpen = true;
+ clearTimeout(animationEndTimeout);
} else if (isOpen) {
isOpen = false;
container.style.opacity = 1;
container.style.pointerEvents = "";
+ animationEndTimeout = setTimeout(function() {
+ if (bgMessage.parentNode)
+ bgMessage.parentNode.removeChild(bgMessage);
+ }, 350);
}
};
View
6 plugins-client/ext.editors/editors.js
@@ -289,7 +289,7 @@ module.exports = ext.register("ext/editors/editors", {
anims.animateMultiple([
{ duration : duration, node: ext, top : (this.showTabs || preview ? 0 : -16) + "px"},
- //{ duration : duration, node: ext, height : ((this.showTabs || preview ? 0 : 16) + ph.offsetHeight - d[1]) + "px"},
+ // { duration : duration, node: ext, height : ((this.showTabs || preview ? 0 : 16) + ph.offsetHeight - d[1]) + "px"},
{ duration : duration, node: tabEditors.$buttons, height: (this.showTabs || preview ? 22 : 7) + "px"},
{ duration : duration, node: this.buttons.add, opacity : dir ? 1 : 0},
{ duration : duration, node: this.buttons.add, height : (dir ? 17 : 10) + "px"},
@@ -463,6 +463,8 @@ module.exports = ext.register("ext/editors/editors", {
doc: doc
});
+ apf.setStyleClass(tabEditors.$ext, "", ["empty"])
+
if (active === false) // init && !
return {editor: editor, page: fake};
@@ -576,6 +578,8 @@ module.exports = ext.register("ext/editors/editors", {
editor.clear && editor.clear();
require("ext/editors/editors").currentEditor = null;
+
+ apf.setStyleClass(tabEditors.$ext, "empty")
}
//Destroy the app page if it has no application instance
View
10 plugins-client/ext.main/style/skins.xml
@@ -10251,6 +10251,14 @@
.editor_tab.hidetabs .btnsesssioncontainer:hover .tab_middle{
text-indent: 0;
}*/
+
+ .editor_tab:not(.empty) .editor_bg {
+ display: none;
+ }
+
+ .editor_tab:not(.empty) {
+ background: #F0F0F0 none;
+ }
]]></a:style>
<a:style condition="apf.isGecko">
.editor_tab.hidetabs .session_btn:not(.curbtn) {
@@ -10384,7 +10392,7 @@
<a:presentation>
<a:main pages="." buttons="div[1]">
- <div class="editor_tab">
+ <div class="editor_tab empty">
<div class="btnsesssioncontainer">
</div>
View
4 plugins-client/ext.main/style/style.css
@@ -137,7 +137,7 @@ BODY {
left: 0;
width: 100%;
height: 100%;
- visibility: hidden;
+ display: none;
background-color: rgba(255, 255, 255, 0);
color: #000;
text-align: center;
@@ -149,7 +149,7 @@ BODY {
}
.draganddrop.over {
- visibility: visible;
+ display: block;
background-color: rgba(255, 255, 255, .5);
}
View
12 plugins-client/ext.themes/themes.js
@@ -134,12 +134,14 @@ module.exports = ext.register("ext/themes/themes", {
apf.setStyleClass(tabsDiv, "", ["dark"]);
}
- var cssClass = theme.cssClass;
+ // !important puting ace into more divs with theme.cssClass makes it slower
+ var aceClass = theme.cssClass;
+ var cssClass = aceClass.replace(/^ace/, "c9");
if (_self.lastTheme) {
apf.setStyleClass(editorDiv, "", [_self.lastTheme]);
apf.setStyleClass(editorHolder, "", [_self.lastTheme]);
- apf.setStyleClass(tabsDiv, "", [_self.lastTheme]);
+ apf.setStyleClass(tabsDiv, "", [_self.lastTheme]);
}
_self.lastTheme = cssClass;
@@ -153,12 +155,10 @@ module.exports = ext.register("ext/themes/themes", {
_self.loaded[path] = true;
- var bg = apf.getStyleRule("." + cssClass + " .ace_gutter", "backgroundColor");
- var fg = apf.getStyleRule("." + cssClass + " .ace_gutter", "color");
+ var bg = apf.getStyleRule("." + aceClass + " .ace_gutter", "backgroundColor");
+ var fg = apf.getStyleRule("." + aceClass + " .ace_gutter", "color");
apf.importStylesheet([
- ["." + cssClass + " .ace_editor",
- "border: 0 !important;"],
(apf.isGecko ? [] :
["#tabsDiv." + cssClass + " .curbtn .tab_middle",
(theme.isDark ? "color:rgba(255, 255, 255, 0.8)" : "")
View
4 plugins-client/ext.zen/zen.js
@@ -513,7 +513,7 @@ module.exports = ext.register("ext/zen/zen", {
apf.tween.single(btnZenFullscreen, {
type : "opacity",
anim : apf.tween.easeInOutCubic,
- from : 0.01,
+ from : 0,
to : 1,
steps : 8,
interval : 20,
@@ -532,7 +532,7 @@ module.exports = ext.register("ext/zen/zen", {
type : "opacity",
anim : apf.tween.easeInOutCubic,
from : 1,
- to : 0.01,
+ to : 0,
steps : 8,
interval : 20,
control : (this.control = {}),

0 comments on commit c251f2d

Please sign in to comment.
Something went wrong with that request. Please try again.