Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
hide WorkingSetView when empty. clean up extra DOM and style rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonsanjose committed Apr 22, 2013
1 parent 5c65061 commit 04848ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
31 changes: 13 additions & 18 deletions src/htmlContent/main-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,19 @@

<!-- Main UI: horizontal set of sidebar, main content vertical stack, and vertical toolbar -->
<div class="main-view">
<div id="sidebar" class="sidebar quiet-scrollbars horz-resizable right-resizer collapsible" data-minsize="0" data-forceleft=".content">
<!-- Left-hand 'Project panel' -->
<div id="projects" class="panel">
<div id="project-header">{{WORKING_FILES}}</div>
<div id="file-section">
<div id="open-files-container">
<!-- This will contain a dynamically generated <ul> at runtime -->
<ul>
</ul>
</div>

<div id="project-files-header">
<span id="project-title" class="title"></span>
</div>
<div id="project-files-container">
<!-- This will contain a dynamically generated <ul> hierarchy at runtime -->
</div>
</div>
<div id="sidebar" class="sidebar panel quiet-scrollbars horz-resizable right-resizer collapsible" data-minsize="0" data-forceleft=".content">
<div id="working-set-header">{{WORKING_FILES}}</div>
<div id="open-files-container">
<!-- This will contain a dynamically generated <ul> at runtime -->
<ul>
</ul>
</div>

<div id="project-files-header">
<span id="project-title" class="title"></span>
</div>
<div id="project-files-container">
<!-- This will contain a dynamically generated <ul> hierarchy at runtime -->
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions src/project/WorkingSetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ define(function (require, exports, module) {
* Use listItem.data(_FILE_KEY) to get the document reference
*/
var _FILE_KEY = "file",
$workingSetHeader,
$openFilesContainer,
$openFilesList;

Expand Down Expand Up @@ -82,8 +83,10 @@ define(function (require, exports, module) {
function _redraw() {
if (DocumentManager.getWorkingSet().length === 0) {
$openFilesContainer.hide();
$workingSetHeader.hide();
} else {
$openFilesContainer.show();
$workingSetHeader.show();
}
_adjustForScrollbars();
_fireSelectionChanged();
Expand Down Expand Up @@ -555,6 +558,7 @@ define(function (require, exports, module) {
function create(element) {
// Init DOM element
$openFilesContainer = element;
$workingSetHeader = $("#working-set-header");
$openFilesList = $openFilesContainer.find("ul");

// Register listeners
Expand Down
10 changes: 2 additions & 8 deletions src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ a, img {

/* Project panel */

#project-header {
/* Fixed height blank space for now. The mockups have the window "stoplights" or a logo here. */
#working-set-header {
height: 19px;
padding: 10px 0 9px 12px;
background: #3C3F41;
color: @project-panel-text-2;
}

#sidebar {
position: relative;
white-space: nowrap;
}

Expand All @@ -351,12 +351,6 @@ a, img {
z-index: @z-index-brackets-sidebar-resizer;
opacity: 0;
cursor: col-resize;
}

#file-section {
.vbox;
.box-flex(1);
position: relative;
}

#project-files-header {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ViewUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ define(function (require, exports, module) {
* div to align a single selected list item from a ul list element.
*
* Assumptions:
* - scrollElement is a child of the #file-section div
* - scrollerElement is a child of the #sidebar div
* - ul list element fires a "selectionChanged" event after the
* selectedClassName is assigned to a new list item
*
Expand Down

0 comments on commit 04848ee

Please sign in to comment.