TagSpaces is an offline, open source, document manager with tagging support
Deactivating toptoolbar on startup Deactivating toptoolbar on location close
Ilianf9cfc8b06686
diff --git a/data/index.html b/data/index.htmlindex 0bca66b92..f7ac97490 100644--- a/data/index.html+++ b/data/index.html@@ -130,15 +130,15 @@ can be found in the LICENSE file.</button></span><div class="input-group">- <button type="button" style="margin-left: 5px;" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><i id="currentPerspectitveIcon" class="fa fa-film"></i> - <span id="currentPerspectitveName">Choose Perspective</span> <span class="caret"></span>+ <button type="button" id="perspectiveSwitcherButton" style="margin-left: 5px;" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><i id="currentPerspectitveIcon" class="fa fa-film"></i> + <span id="currentPerspectitveName">Perspectives</span> <span class="caret"></span></button><ul class="dropdown-menu pull-right" style="position:absolute; top:35px; right:2px; width: 200px;" id="viewSwitcher"></ul></div></div></div></div>- <div id="viewToolbars"></div>+ <div id="viewToolbars"> </div></nav><div class="ts-container" id="viewContainers"></div></div>@@ -560,7 +560,7 @@ can be found in the LICENSE file.</ul></div>-<div id="contactUsContent">+<div id="contactUsContent" style="visibility: hidden"><a class="btn btn-default btn-block" title="About TagSpaces" data-toggle="modal" data-target="#dialogAboutTS"><i class="fa fa-comment-o"></i> About TagSpaces</a><a class="btn btn-default btn-block" url="https://tagspaces.uservoice.com/forums/213931-general" id="openUservoice" title="Suggest or vote for a feature"> <i class="fa fa-bullhorn"></i> Suggest New Features </a><a class="btn btn-default btn-block" url="https://github.com/uggrock/tagspaces/issues/" target="_system" id="openGitHubIssues" title="Report an issue"><i class="fa fa-flag"></i> Report Issue</a>diff --git a/data/js/core.api.js b/data/js/core.api.jsindex 0750c4527..9fa7e1105 100644--- a/data/js/core.api.js+++ b/data/js/core.api.js@@ -508,6 +508,8 @@ define(function(require, exports, module) {exports.updateFileModel = updateFileModel;// Proxying functions from tsCoreUI+ exports.enableTopToolbar = tsCoreUI.enableTopToolbar;+ exports.disableTopToolbar = tsCoreUI.disableTopToolbar;exports.showAlertDialog = tsCoreUI.showAlertDialog;exports.showConfirmDialog = tsCoreUI.showConfirmDialog;exports.showTagEditDialog = tsCoreUI.showTagEditDialog;diff --git a/data/js/core.ui.js b/data/js/core.ui.jsindex a34336512..2df0f0b46 100644--- a/data/js/core.ui.js+++ b/data/js/core.ui.js@@ -345,6 +345,7 @@ define(function(require, exports, module) {});$("#searchBox")+ .prop('disabled', true).focus(function(e) {//$(this).removeClass("input-medium");//$(this).addClass("input-large");@@ -373,7 +374,9 @@ define(function(require, exports, module) {}});- $("#searchButton").click(function(evt) {+ $("#searchButton")+ .prop('disabled', true)+ .click(function(evt) {evt.preventDefault();$( "#clearFilterButton").addClass("filterOn");$("#searchOptions").hide();@@ -381,6 +384,7 @@ define(function(require, exports, module) {});$("#clearFilterButton")+ .prop('disabled', true).click(function(evt) {evt.preventDefault();$("#searchOptions").hide();@@ -400,7 +404,9 @@ define(function(require, exports, module) {});// Search UI END-++ $('#perspectiveSwitcherButton').prop('disabled', true);+$('#contactUs').popover({placement: 'top',content: $("#contactUsContent").html(),@@ -434,6 +440,34 @@ define(function(require, exports, module) {});};++ function disableTopToolbar() {+ $("#perspectiveSwitcherButton")+ .prop('disabled', true);++ $("#searchBox")+ .prop('disabled', true);++ $("#searchButton")+ .prop('disabled', true);++ $("#clearFilterButton")+ .prop('disabled', true);+ }++ function enableTopToolbar() {+ $("#perspectiveSwitcherButton")+ .prop('disabled', false);++ $("#searchBox")+ .prop('disabled', false);++ $("#searchButton")+ .prop('disabled', false);++ $("#clearFilterButton")+ .prop('disabled', false);+ }function platformTuning() {if(isCordova) {@@ -505,6 +539,8 @@ define(function(require, exports, module) {// Public API definitionexports.showContextMenu = showContextMenu;exports.initUI = initUI;+ exports.enableTopToolbar = enableTopToolbar;+ exports.disableTopToolbar = disableTopToolbar;exports.showAlertDialog = showAlertDialog;exports.showConfirmDialog = showConfirmDialog;exports.showFileRenameDialog = showFileRenameDialog;diff --git a/data/js/directories.ui.js b/data/js/directories.ui.jsindex 287396275..4d7fbecc3 100644--- a/data/js/directories.ui.js+++ b/data/js/directories.ui.js@@ -33,9 +33,7 @@ define(function(require, exports, module) {// Handle open default perspective for a locationvar defaultPerspective = currentLocation.perspective;- if(defaultPerspective != undefined) {- TSCORE.PerspectiveManager.changePerspective(defaultPerspective);- }+ TSCORE.PerspectiveManager.changePerspective(defaultPerspective);}// Updates the directory subtree@@ -552,6 +550,14 @@ define(function(require, exports, module) {$("#locationName").text("Choose Location");$("#locationName").attr("title","");$("#locationContent").empty();++ // Clear the footer+ $("#statusBar").empty();+ $("#alternativeNavigator").empty();+++ TSCORE.disableTopToolbar();+ TSCORE.PerspectiveManager.hideAllPerspectives();}function showDeleteFolderConnectionDialog(name) {diff --git a/data/js/perspective.manager.js b/data/js/perspective.manager.jsindex bc7c5c804..18f06782a 100644--- a/data/js/perspective.manager.js+++ b/data/js/perspective.manager.js@@ -93,11 +93,6 @@ var initPerspectiveSwitcher = function() {changePerspective($(this).attr("viewid"));});};-- if(perspectives.length > 0) {- TSCORE.currentView = perspectives[0].ID;- changePerspective(TSCORE.currentView);- }};var redrawCurrentPerspective = function () {@@ -200,7 +195,7 @@ var updateFileBrowserData = function(dirList) {}}}- changePerspective(TSCORE.currentView);+ changePerspective(TSCORE.currentView);};var refreshFileListContainer = function() {@@ -208,22 +203,32 @@ var refreshFileListContainer = function() {TSCORE.IO.listDirectory(TSCORE.currentPath);};+var hideAllPerspectives = function() {+ for (var i=0; i < perspectives.length; i++) {+ $( "#"+perspectives[i].ID+"Container" ).hide();+ $( "#"+perspectives[i].ID+"Toolbar" ).hide();+ $( "#"+perspectives[i].ID+"Footer" ).hide();+ }+};+var changePerspective = function (viewType) {console.log("Change to "+viewType+" view.");TSCORE.showLoadingAnimation();- //Setting the current view- TSCORE.currentView = viewType;+ // Loading first perspective by default+ if(viewType == undefined) {+ TSCORE.currentView = perspectives[0].ID;+ } else {+ //Setting the current view+ TSCORE.currentView = viewType;+ }++ if(TSCORE.currentView == undefined) {+ TSCORE.showAlertDialog("No Perspectives found","");+ return false;+ }-/* if(TSCORE.currentPath == undefined) {- TSCORE.showAlertDialog("Please select first location from the dropdown on the left!");- }*/-- for (var i=0; i < perspectives.length; i++) {- $( "#"+perspectives[i].ID+"Container" ).hide();- $( "#"+perspectives[i].ID+"Toolbar" ).hide();- $( "#"+perspectives[i].ID+"Footer" ).hide();- }+ hideAllPerspectives();for (var i=0; i < perspectives.length; i++) {if(perspectives[i].ID == viewType) {@@ -241,7 +246,10 @@ var changePerspective = function (viewType) {}// Clear the list with the selected files- exports.clearSelectedFiles();+ clearSelectedFiles();++ // Enabled the search functionality+ TSCORE.enableTopToolbar();TSCORE.hideLoadingAnimation();};@@ -258,7 +266,8 @@ var clearSelectedFiles = function () {}};-exports.initPerspectives = initPerspectives;+exports.initPerspectives = initPerspectives;+exports.hideAllPerspectives = hideAllPerspectives;exports.redrawCurrentPerspective = redrawCurrentPerspective;exports.getNextFile = getNextFile;exports.getPrevFile = getPrevFile;diff --git a/data/js/postioapi.js b/data/js/postioapi.jsindex 65da064bc..3c4d9570e 100644--- a/data/js/postioapi.js+++ b/data/js/postioapi.js@@ -40,10 +40,9 @@ define(function(require, exports, module) {newFileConaintingPath = TSCORE.TagUtils.extractContainingDirectoryPath(newFilePath);if(oldFileContainingPath != newFileConaintingPath) {// File was moved- //TSCORE.removeFileModel(TSCORE.fileList, filePath);// TODO consider case - file was moved in subdir shown in the recursive search results- TSCORE.PerspectiveManager.removeFileUI(oldFilePath);- TSCORE.updateFileModel(TSCORE.fileList, oldFilePath, newFilePath);+ TSCORE.removeFileModel(TSCORE.fileList, oldFilePath);+ TSCORE.PerspectiveManager.removeFileUI(oldFilePath);} else {// File was just renamedTSCORE.updateFileModel(TSCORE.fileList, oldFilePath, newFilePath);@@ -81,7 +80,7 @@ define(function(require, exports, module) {exports.errorOpeningPath = function() {TSCORE.showAlertDialog("Error occured while opening a path! Currently opened location will be closed.");TSCORE.closeCurrentLocation();- TSCORE.PerspectiveManager.updateFileBrowserData([]);+ //TSCORE.PerspectiveManager.updateFileBrowserData([]);};exports.deleteElement = function(filePath) {