Skip to content

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

redifining backbutton cordova

Ilian88866b65f25a
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.js
index 6f2d3af61..619158c17 100644
--- a/data/cordova/cordova.api.js
+++ b/data/cordova/cordova.api.js
@@ -16,6 +16,14 @@ define(function (require, exports, module) {
// Cordova loaded and can be used
function onDeviceReady() {
console.log("Devive Ready: "+device.platform+" - "+device.version);
+
+ // Redifining the back button
+ document.addEventListener("backbutton", function(e){
+ TSCORE.FileOpener.closeFile();
+ $('.modal').modal('hide');
+ e.preventDefault();
+ }, false);
+
getFileSystem();
}