Skip to content

TagSpaces is an offline, open source, document manager with tagging support

refactoring layout location management

uggrock54d376381bad
diff --git a/data/assets/layout.css b/data/assets/layout.css
index 83a420b4e..3a24f5ad1 100644
--- a/data/assets/layout.css
+++ b/data/assets/layout.css
@@ -1,7 +1,7 @@
/* Copyright (c) 2012-2015 The TagSpaces Authors. All rights reserved. Use of this source code
* is governed by a AGPL3 license that can be found in the LICENSE file. */
-#panel {
+#mainContainer {
display: flex;
display: -webkit-flex;
display: -ms-flexbox;
@@ -199,3 +199,47 @@
.col1 .navbar, .col2 .navbar, .col3 .navbar {
padding-left: 5px;
}
+
+.flexLayout {
+ display: flex;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+}
+
+/*==== Location Management ====== */
+
+#locationSwitch {
+ width: 96%;
+}
+
+#locationName {
+ flex: 1 1 auto;
+ -webkit-flex: 1 1 auto;
+ -ms-flex: 1 1 auto;
+}
+
+#selectLocation {
+ flex: 0 1 40px;
+ -webkit-flex: 0 1 40px;
+ -ms-flex: 0 1 40px;
+}
+
+#locationsList {
+ overflow-y: auto;
+ max-height: 500px;
+ width: 280px;
+}
+
+.openLocation {
+ flex: 1 1 auto;
+ -webkit-flex: 1 1 auto;
+ -ms-flex: 1 1 auto;
+ text-align: left;
+ line-height: 30px;
+}
+
+.editLocation {
+ flex: 0 1 50px;
+ -webkit-flex: 0 1 50px;
+ -ms-flex: 0 1 50px;
+}
\ No newline at end of file
diff --git a/data/assets/tagspaces.css b/data/assets/tagspaces.css
index daa014234..248cb8793 100644
--- a/data/assets/tagspaces.css
+++ b/data/assets/tagspaces.css
@@ -1,7 +1,7 @@
/* Copyright (c) 2012-2015 The TagSpaces Authors. All rights reserved. Use of this source code
* is governed by a AGPL3 license that can be found in the LICENSE file. */
-@import '../libs/bootstrap/css/bootstrap.min.css';
+@import '../libs/bootstrap/css/bootstrap.css';
@import '../libs/select2/select2.css';
@import '../libs/select2/select2-bootstrap.css';
@import '../libs/jquery-simplecolorpicker/jquery.simplecolorpicker.css';
diff --git a/data/index.html b/data/index.html
index 880e0858b..0dee701ce 100644
--- a/data/index.html
+++ b/data/index.html
@@ -48,11 +48,11 @@
</div>
</div>
-<main id="panel">
+<main id="mainContainer">
<div class="col1">
<div class="row1">
<nav class="navbar navbar-default" role="navigation">
- <div class="btn-toolbar" style="width: 100%">
+ <div class="btn-toolbar">
<span id="startNewInstanceBack" data-i18n="[title]ns.common:openNewInstanceTooltip">
<span id="logo">TagSpaces</span>
<sup id="appVersion"></sup>
@@ -63,21 +63,20 @@
<i class="glyphicon glyphicon-gift fa-lg"></i>
</button>
<button class="btn btn-link" data-i18n="[title]ns.common:openSettingTooltip;" id="openOptions"
- style="padding-right: 0px;" data-placement="bottom;" data-original-title="Start using TagSpaces by creating a new location!">
+ data-placement="bottom;" data-original-title="Start using TagSpaces by creating a new location!">
<i class="fa fa-gears fa-lg"></i>&nbsp;
</button>
</div>
</div>
<div class="btn-toolbar">
- <div class="btn-group" style="width: 96%; display: flex;" id="locationSwitch">
- <button type="button" class="btn btn-default" data-i18n="ns.common:chooseLocation" style="flex: 1 1 auto;"
- id="locationName" data-toggle="dropdown">Choose Location
+ <div class="btn-group flexLayout" id="locationSwitch">
+ <button type="button" class="btn btn-default" data-i18n="ns.common:chooseLocation"
+ id="locationName" data-toggle="dropdown">
</button>
- <button type="button" class="btn btn-default dropdown-toggle" id="selectLocation" style="flex: 0 1 40px;"
- data-toggle="dropdown">
+ <button type="button" class="btn btn-default dropdown-toggle" id="selectLocation" data-toggle="dropdown">
<span class="caret"></span>
</button>
- <ul class="dropdown-menu" id="locationsList" style="overflow-y: auto; max-height: 500px; width: 280px;"></ul>
+ <ul class="dropdown-menu" id="locationsList"></ul>
</div>
</div>
</nav>
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 0089df604..e8ea19945 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -707,9 +707,8 @@ define(function(require, exports, module) {
});
};
var hideAllDropDownMenus = function() {
- //$('#tagGroupMenu').hide();
- //$('#tagTreeMenu').hide();
- //$('#contactUsContent').hide();
+ $('#tagGroupMenu').hide();
+ $('#tagTreeMenu').hide();
$('#directoryMenu').hide();
$('#tagMenu').hide();
$('#fileMenu').hide();
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index bde61287c..12c2b4bb0 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -40,6 +40,7 @@ define(function(require, exports, module) {
'</div>' +
'{{/each}}'
);
+
var mainDirectoryNavigatorTmpl = Handlebars.compile(
'<div>{{#each dirHistory}}' +
'<div class="accordion-group disableTextSelection" style="width: 99%; border: 0px #aaa solid;">' +
@@ -67,25 +68,26 @@ define(function(require, exports, module) {
'</div>' +
'{{/each}}</div>'
);
+
var locationChooserTmpl = Handlebars.compile(
- '<li style="display: flex;">' +
+ '<li class="flexLayout"">' +
'<button style="text-align: left;" class="btn btn-link" id="createNewLocation">' +
'<i class="fa fa-plus"></i>&nbsp;<span data-i18n="[title]ns.common:connectNewLocationTooltip;ns.common:connectNewLocationTooltip"></span>' +
'</button>' +
'</li>' +
'<li class="divider"></li>' +
'<li class="dropdown-header" data-i18n="ns.common:yourLocations">{{yourLocations}}</li>' +
- //'<li class="divider"></li>' +
+ '<li class="divider"></li>' +
'{{#each locations}}' +
- '<li style="line-height: 45px; display: flex;">' +
- '<button title="{{path}}" path="{{path}}" name="{{name}}" style="flex: 1 1 auto; text-align: left;" class="btn btn-link openLocation">' +
+ '<li class="flexLayout">' +
+ '<button title="{{path}}" path="{{path}}" name="{{name}}" class="btn btn-link openLocation">' +
'{{#if isDefault}}' +
'<i style="color: darkred" class="fa fa-bookmark" data-i18n="[title]ns.dialogs:startupLocation"></i>&nbsp;{{name}}' +
'{{else}}' +
'<i class="fa fa-bookmark"></i>&nbsp;{{name}}' +
'{{/if}}' +
'</button>' +
- '<button type="button" data-i18n="[title]ns.common:editLocation" title="{{editLocationTitle}}" location="{{name}}" path="{{path}}" class="btn btn-link pull-right editLocation" style="flex: 0 1 50px;">' +
+ '<button type="button" data-i18n="[title]ns.common:editLocation" title="{{editLocationTitle}}" location="{{name}}" path="{{path}}" class="btn btn-link pull-right editLocation">' +
'<i class="fa fa-pencil fa-lg"></i>' +
'</button>' +
'</li>' +