Skip to content

Commit

Permalink
refactor: move status bar template to index html for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 3, 2023
1 parent 60d70ec commit 56b0eba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
22 changes: 19 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,27 @@

<div id="editor-holder">
<!-- View Panes are programatically created here -->
</div>

</div>
<div id="status-bar" class="statusbar no-focus">
<div id="status-info" class="info" >
<div id="status-cursor"></div>
<div id="status-file"></div>
</div>
<div id="status-indicators" class="indicators">
<div id="status-indent">
<div id="indent-type"></div>
<div id="indent-width-label"></div>
<input id="indent-width-input" type="number" min="1" max="10" maxlength="2" size="2" class="hidden">
</div>
<div id="status-language"></div>
<div id="status-encoding"></div>
<div id="status-overwrite"></div>
<div class="spinner"></div>
</div>
</div>
<!-- Bottom panels and status bar are programmatically created here -->

</div>
</div>

<!-- Vertical toolbar docked to right -->
<div id="main-toolbar" class="toolbar no-focus collapsible">
Expand Down
17 changes: 0 additions & 17 deletions src/widgets/StatusBar.html

This file was deleted.

8 changes: 2 additions & 6 deletions src/widgets/StatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ define(function (require, exports, module) {


var AppInit = require("utils/AppInit"),
StatusBarHTML = require("text!widgets/StatusBar.html"),
Strings = require("strings"),
WorkspaceManager = require("view/WorkspaceManager"),
Mustache = require("thirdparty/mustache/mustache");
WorkspaceManager = require("view/WorkspaceManager");

var _init = false;

Expand Down Expand Up @@ -246,9 +244,7 @@ define(function (require, exports, module) {
}

AppInit.htmlReady(function () {
var $parent = $(".main-view .content");
$parent.append(Mustache.render(StatusBarHTML, Strings));

$("#status-overwrite").text(Strings.STATUSBAR_INSERT);
// Initialize items dependent on HTML DOM
$statusBar = $("#status-bar");
$indicators = $("#status-indicators");
Expand Down

0 comments on commit 56b0eba

Please sign in to comment.