Skip to content

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

redesigning the left menu toggle functionality, fixing various layout issues

uggrock8e38bb111737
diff --git a/data/assets/general.css b/data/assets/general.css
index e1c4055e0..09e3470ae 100644
--- a/data/assets/general.css
+++ b/data/assets/general.css
@@ -268,23 +268,6 @@ li hr {
overflow: hidden !important;
}
-#toggleLeftPanel {
- border: 0;
- display: block;
- padding-left: 5px;
- padding-top: 10px;
- margin: 0;
- background-color: #f2f2f2;
-}
-
-#toggleLeftPanel .icon-bar {
- height: 3px;
-}
-
-#toggleLeftPanel:focus, #toggleLeftPanel:hover {
- background-color: #f2f2f2 !important;
-}
-
#searchToolbar {
width: 250px;
background-color: #f2f2f2;
@@ -639,8 +622,6 @@ input a.resetFilter {
#newVersionAvailable {
padding-top: 8px;
- padding-right: 3px;
- padding-left: 3px;
color: #7bd148;
display: none;
}
diff --git a/data/ext/perspectiveGrid/extension.js b/data/ext/perspectiveGrid/extension.js
index f7f5e7700..256df147a 100644
--- a/data/ext/perspectiveGrid/extension.js
+++ b/data/ext/perspectiveGrid/extension.js
@@ -30,7 +30,9 @@ define(function(require, exports, module) {
UI = new extUI.ExtUI(extensionID);
UI.buildUI(toolbarTemplate);
platformTuning();
-
+ if(isCordova) {
+ TSCORE.reLayout();
+ }
$('#' + extensionID + 'Container [data-i18n]').i18n();
});
};
diff --git a/data/ext/perspectiveList/extension.js b/data/ext/perspectiveList/extension.js
index 725b71fe9..98e17cd40 100644
--- a/data/ext/perspectiveList/extension.js
+++ b/data/ext/perspectiveList/extension.js
@@ -67,6 +67,10 @@ define(function(require, exports, module) {
$('#' + extensionID + 'Container').find("th:contains('File Name')").text(translation);
}
+ if(isCordova) {
+ TSCORE.reLayout();
+ }
+
$('#' + extensionID + 'Container [data-i18n]').i18n();
platformTuning();
diff --git a/data/index.html b/data/index.html
index 17aacb472..43af268c2 100644
--- a/data/index.html
+++ b/data/index.html
@@ -61,8 +61,8 @@
data-i18n="[title]ns.common:newVersionAvailableTooltip">
<i class="glyphicon glyphicon-gift fa-lg"></i>
</button>
- <button class="btn btn-link" data-i18n="[title]ns.common:openSettingTooltip;" id="openOptions">
- <i class="fa fa-gears fa-lg"></i>&nbsp;
+ <button class="btn btn-link" data-i18n="[title]ns.common:;" id="closeLeftPanel">
+ <i class="fa fa-arrow-left fa-lg"></i>
</button>
</div>
</div>
@@ -140,6 +140,7 @@
<i class="fa fa-thumbs-o-up fa-stack-1x"></i></span>&nbsp;&nbsp;
<span data-i18n="ns.common:supportUs"></span>
</a><br>
+ <hr style="margin: 0; border-top: 1px solid #ddd" />
<a class="btn btn-link" data-i18n="[title]ns.common:tweetAboutUsTooltip"
href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Ftagspaces.org%2F&text=Organize%20your%20files%20with%20@tagspaces"
id="openTwitter">
@@ -189,16 +190,18 @@
<input type="radio" name="options">&nbsp;<i class="fa fa-info-circle"></i>
</label>
</div>
+ <button class="btn btn-link pull-right" data-i18n="[title]ns.common:openSettingTooltip;" id="openOptions">
+ <i class="fa fa-gears fa-lg"></i>
+ </button>
</div>
</div>
<div class="col2">
<div class="row1">
<nav class="navbar navbar-default" role="navigation">
- <div class="btn-toolbar flexLayout">
- <button type="button" class="navbar-toggle" id="toggleLeftPanel"
- data-i18n="[title]ns.common:toggleLeftPanelTooltip">
- <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
+ <div class="flexLayout" style="min-height: 40px;">
+ <button type="button" class="btn btn-link" id="openLeftPanel" data-i18n="[title]ns.common:toggleLeftPanelTooltip">
+ <i class="fa fa-arrow-right fa-lg"></i>
</button>
<div class="flexMaxWidth">
<div id="loadingAnimation" class="">
@@ -209,7 +212,7 @@
</div>
</div>
</div>
- <div id="mainTopMenu" class="input-group" style="white-space: nowrap;">
+ <div id="mainTopMenu" class="input-group">
<button type="button" id="perspectiveSwitcherButton" class="btn btn-link dropdown-toggle"
data-toggle="dropdown"><i id="currentPerspectitveIcon" class="fa fa-film"></i>&nbsp;
<span id="currentPerspectitveName">Perspectives</span>&nbsp;<span class="caret"></span>
@@ -218,8 +221,8 @@
</div>
</div>
<div class="flexLayout">
- <div class="btn-toolbar flexMaxWidth flexLayout">
- <div class="btn-group " id="alternativeNavigator"></div>
+ <div class="flexMaxWidth flexLayout" style="min-width: 100px;">
+ <div class="btn-group " id="alternativeNavigator" style="min-width: 100px;"></div>
<div id="statusBar" class="noWrap flexMaxWidth"></div>
<div id="searchToolbar">
<div class="flexLayout">
@@ -242,7 +245,7 @@
<div class="row2" id="viewContainers"></div>
</div>
- <div class="col3">
+ <div class="col3" style="display: none;">
<div class="row1">
<nav class="navbar navbar-default" role="navigation">
<div class="btn-toolbar flexLayout" >
@@ -809,6 +812,7 @@
<div id="tagGroupMenu" class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" style="display:block;position:static;">
<li class="dropdown-header">
+ <button class="close">&times;</button>
<span data-i18n="ns.common:tagGroupOperations"></span></li>
<li class="divider"></li>
<li><a id="tagGroupMenuCreateNewTag" data-i18n="[title]ns.common:addTagsTooltip">
@@ -835,6 +839,7 @@
<div id="directoryMenu" class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" style="display:block;position:static;">
<li class="dropdown-header">
+ <button class="close">&times;</button>
<span data-i18n="ns.common:directoryOperations"></span></li>
<li class="divider"></li>
<li><a id="directoryMenuReloadDirectory" data-i18n="[title]ns.common:reloadDirectoryTooltip">
diff --git a/data/js/core.api.js b/data/js/core.api.js
index e51bfd7cb..d9ffead7e 100644
--- a/data/js/core.api.js
+++ b/data/js/core.api.js
@@ -64,7 +64,7 @@ define(function(require, exports, module) {
hideLoadingAnimation();
$(document).ready(function() {
- initLayout();
+ reLayout();
var language = tsSettings.getInterfaceLangauge();
// "de-DE"
@@ -95,15 +95,6 @@ define(function(require, exports, module) {
});
}
- function switchIOAPI(type) {
- if (type == 'dropbox') {
- tsIOApiDropbox.init();
- exports.IO = tsIOApiDropbox;
- } else {
- exports.IO = tsIOApi;
- }
- }
-
function switchInterfaceLanguage(language) {
$.i18n.init({
ns: {
@@ -210,17 +201,14 @@ define(function(require, exports, module) {
}
var $loadingAnimation = $('#loadingAnimation');
- var $col2Footer = $('#col2Footer');
function showLoadingAnimation() {
- $col2Footer.hide();
$loadingAnimation.show();
}
function hideLoadingAnimation() {
setTimeout(function() {
$loadingAnimation.hide();
- $col2Footer.show();
}, 500);
}
@@ -302,6 +290,8 @@ define(function(require, exports, module) {
var oneColumn = fullWidth < 660;
var twoColumn = fullWidth >= 660 && fullWidth < 1024;
+ showPerspectiveMenu();
+
if (isFullWidth) {
oneColumn = true;
}
@@ -313,6 +303,7 @@ define(function(require, exports, module) {
shouldOpenCol1 = true;
shouldOpenCol2 = true;
shouldOpenCol3 = false;
+ hidePerspectiveMenu();
} else {
shouldOpenCol2 = true;
}
@@ -320,6 +311,7 @@ define(function(require, exports, module) {
$('#toggleFullWidthButton').hide();
}
} else if (twoColumn) {
+ $("#openLeftPanel").show();
shouldOpenCol2 = true;
if (shouldOpenCol3) {
shouldOpenCol1 = false;
@@ -332,26 +324,38 @@ define(function(require, exports, module) {
shouldOpenCol2 = false;
shouldOpenCol3 = true;
} else {
- shouldOpenCol1 = true;
shouldOpenCol2 = true;
}
}
+
+ if(shouldOpenCol1) {
+ $("#openLeftPanel").hide();
+ }
+
shouldOpenCol1 ? $(".col1").show() : $(".col1").hide();
shouldOpenCol2 ? $(".col2").show() : $(".col2").hide();
shouldOpenCol3 ? $(".col3").show() : $(".col3").hide();
}
+ function hidePerspectiveMenu() {
+ $(".perspectiveMainMenuButton").hide();
+ }
+
+ function showPerspectiveMenu() {
+ $(".perspectiveMainMenuButton").show();
+ }
+
function openFileViewer() {
tsCoreUI.hideAllDropDownMenus();
shouldOpenCol3 = true;
- $(".perspectiveMainMenuButton").parent().hide();
+ hidePerspectiveMenu();
reLayout();
}
function closeFileViewer() {
shouldOpenCol3 = false;
isFullWidth = false;
- $(".perspectiveMainMenuButton").parent().show();
+ showPerspectiveMenu();
reLayout();
}
@@ -360,14 +364,18 @@ define(function(require, exports, module) {
reLayout();
}
- function toggleLeftPanel() {
- $(".col1").toggle();
- shouldOpenCol1 = !shouldOpenCol1;
+ function closeLeftPanel() {
+ $("#closeLeftPanel").hide();
+ $("#openLeftPanel").show();
+ shouldOpenCol1 = false;
+ reLayout();
}
function openLeftPanel() {
- $(".col1").show();
+ $("#openLeftPanel").hide();
+ $("#closeLeftPanel").show();
shouldOpenCol1 = true;
+ reLayout();
}
function reloadUI() {
@@ -378,12 +386,6 @@ define(function(require, exports, module) {
$(window).on('resize', reLayout);
- function initLayout() {
- console.log('Initializing Layout...');
-
- reLayout();
- }
-
function createDocumentEvent(type, data) {
var evt = document.createEvent('Events');
evt.initEvent(type, false, false);
@@ -418,10 +420,11 @@ define(function(require, exports, module) {
exports.showLoadingAnimation = showLoadingAnimation;
exports.hideLoadingAnimation = hideLoadingAnimation;
exports.reloadUI = reloadUI;
+ exports.reLayout = reLayout;
exports.openFileViewer = openFileViewer;
exports.closeFileViewer = closeFileViewer;
- exports.toggleLeftPanel = toggleLeftPanel;
exports.openLeftPanel = openLeftPanel;
+ exports.closeLeftPanel = closeLeftPanel;
exports.toggleFullWidth = toggleFullWidth;
exports.updateNewVersionData = updateNewVersionData;
exports.exportFileListCSV = exportFileListCSV;
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index b17520387..6dfbd0cec 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -334,8 +334,11 @@ define(function(require, exports, module) {
TSCORE.IO.saveBinaryFile(TSCORE.currentPath + TSCORE.dirSeparator + addFileInputName, event.currentTarget.result);
addFileInputName = undefined;
}
- $('#toggleLeftPanel').click(function() {
- TSCORE.toggleLeftPanel();
+ $('#openLeftPanel').click(function() {
+ TSCORE.openLeftPanel();
+ });
+ $('#closeLeftPanel').click(function() {
+ TSCORE.closeLeftPanel();
});
$('#txtFileTypeButton').click(function(e) {
// Fixes reloading of the application by click