Commit 4cb30e8c authored by techird's avatar techird

修复保存点取消还继续的问题

parent 9d5a594d
...@@ -174,7 +174,7 @@ $(function() { ...@@ -174,7 +174,7 @@ $(function() {
$file_btn = $('<button id="file-btn">文件</button>').addClass('dropdown').appendTo($menu); $file_btn = $('<button id="file-btn">文件</button>').addClass('dropdown').appendTo($menu);
$file_menu = $.kmuidropmenu({ data: createFileMenu() }) $file_menu = $.kmuidropmenu({data: createFileMenu()})
.addClass('file-menu') .addClass('file-menu')
.appendTo('body'); .appendTo('body');
...@@ -712,14 +712,23 @@ $(function() { ...@@ -712,14 +712,23 @@ $(function() {
minder.execCommand('camera', minder.getRoot(), 300); minder.execCommand('camera', minder.getRoot(), 300);
} }
function generateRemotePath() { function generateRemotePath(filename) {
var filename = window.prompt("请输入文件名: ", minder.getMinderTitle()) || minder.getMinderTitle();
return '/apps/kityminder/' + filename + '.km'; return '/apps/kityminder/' + filename + '.km';
} }
function save() { function save() {
if (!currentAccount || save.busy) return; if (!currentAccount || save.busy) return;
var uploadPath, filename;
if (!remotePath) {
filename = window.prompt('请输入文件名: ', minder.getMinderTitle())
if (!filename) return;
uploadPath = generateRemotePath(filename);
} else {
uploadPath = remotePath;
}
save.busy = true; save.busy = true;
var data = minder.exportData('json'); var data = minder.exportData('json');
...@@ -745,7 +754,7 @@ $(function() { ...@@ -745,7 +754,7 @@ $(function() {
upload.tryCount = 0; upload.tryCount = 0;
return; return;
} }
var uploadPath = remotePath || generateRemotePath();
$title.loading('正在保存 “' + getFileName(uploadPath) + '” ...'); $title.loading('正在保存 “' + getFileName(uploadPath) + '” ...');
sto.uploadTextFile(data, uploadPath, { sto.uploadTextFile(data, uploadPath, {
ondup: remotePath ? sto.constant.ONDUP_OVERWRITE : sto.constant.ONDUP_NEWCOPY, ondup: remotePath ? sto.constant.ONDUP_OVERWRITE : sto.constant.ONDUP_NEWCOPY,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment