mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-05-05 23:33:13 +02:00
Fix saving of empty files (#612)
When you have a file without content, for example when you cleared you were unable to save it because of an incorrect if-statement. This is the fix for that problem.
This commit is contained in:
parent
9ee41b14d6
commit
09e2b9a107
|
@ -3804,8 +3804,8 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
||||||
//Save file
|
//Save file
|
||||||
function edit_save(e, t) {
|
function edit_save(e, t) {
|
||||||
var n = "ace" == t ? editor.getSession().getValue() : document.getElementById("normal-editor").value;
|
var n = "ace" == t ? editor.getSession().getValue() : document.getElementById("normal-editor").value;
|
||||||
if (n) {
|
if (typeof n !== 'undefined' && n !== null) {
|
||||||
if(true){
|
if (true) {
|
||||||
var data = {ajax: true, content: n, type: 'save'};
|
var data = {ajax: true, content: n, type: 'save'};
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -3819,9 +3819,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
||||||
failure: function(mes) {toast("Error: try again");},
|
failure: function(mes) {toast("Error: try again");},
|
||||||
error: function(mes) {toast(`<p style="background-color:red">${mes.responseText}</p>`);}
|
error: function(mes) {toast(`<p style="background-color:red">${mes.responseText}</p>`);}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
var a = document.createElement("form");
|
var a = document.createElement("form");
|
||||||
a.setAttribute("method", "POST"), a.setAttribute("action", "");
|
a.setAttribute("method", "POST"), a.setAttribute("action", "");
|
||||||
var o = document.createElement("textarea");
|
var o = document.createElement("textarea");
|
||||||
|
|
Loading…
Reference in a new issue