remove folder and space 'duplication' leftovers
This commit is contained in:
@@ -141,10 +141,6 @@ function import_zip(user, filename, on_success, on_error) {
|
||||
load_resource("get", "/users/"+user._id+"/import?zip="+filename, null, on_success, on_error);
|
||||
}
|
||||
|
||||
function load_writable_folders(on_success, on_error) {
|
||||
load_resource("get", "/spaces?writablefolders=true", null, on_success, on_error);
|
||||
}
|
||||
|
||||
function load_history(s, on_success, on_error) {
|
||||
load_resource("get", "/spaces/"+ s._id +"/digest", null, on_success, on_error);
|
||||
}
|
||||
@@ -190,12 +186,10 @@ function delete_space(s, on_success, on_error) {
|
||||
load_resource("delete", "/spaces/"+s._id, null, on_success, on_error);
|
||||
}
|
||||
|
||||
|
||||
function delete_artifact(a, on_success, on_error) {
|
||||
load_resource("delete", "/spaces/"+a.space_id+"/artifacts/"+a._id);
|
||||
}
|
||||
|
||||
|
||||
function duplicate_space(s, to_space_id, on_success, on_error) {
|
||||
var path = "/spaces/"+s._id+"/duplicate";
|
||||
if(to_space_id) {
|
||||
|
||||
@@ -18,8 +18,6 @@ var SpacedeckSpaces = {
|
||||
active_space_path: [],
|
||||
access_settings_space: null,
|
||||
access_settings_memberships: [],
|
||||
duplicate_folders: [],
|
||||
duplicate_folder_id: "",
|
||||
pending_pdf_files: [],
|
||||
|
||||
meta_visible: false,
|
||||
@@ -673,47 +671,6 @@ var SpacedeckSpaces = {
|
||||
location.href = "/api/spaces/" + space._id + "/list";
|
||||
},
|
||||
|
||||
duplicate_space_into_folder: function() {
|
||||
load_writable_folders( function(folders){
|
||||
this.duplicate_folders = _.sortBy(folders, function (folder) { return folder.name; });
|
||||
}.bind(this), function(xhr) {
|
||||
console.error(xhr);
|
||||
});
|
||||
},
|
||||
|
||||
duplicate_folder_confirm: function() {
|
||||
var folderId = this.duplicate_folder_id;
|
||||
var idx = _.findIndex(this.duplicate_folders, function(s) { return s._id == folderId;});
|
||||
if (idx<0) idx = 0;
|
||||
var folder = this.duplicate_folders[idx];
|
||||
console.log("df f",folder);
|
||||
if (!folder) return;
|
||||
|
||||
duplicate_space(this.active_space, folder._id, function(new_space) {
|
||||
|
||||
this.duplicate_folders = [];
|
||||
this.duplicate_folder = null;
|
||||
|
||||
smoke.quiz(__("duplicate_success", this.active_space.name, folder.name), function(e, test){
|
||||
if (e == __("goto_space", new_space.name)){
|
||||
this.redirect_to("/spaces/" + new_space._id);
|
||||
}else if (e == __("goto_folder", folder.name)){
|
||||
this.redirect_to("/folders/" + folder._id);
|
||||
}
|
||||
}.bind(this), {
|
||||
button_1: __("goto_space", new_space.name),
|
||||
button_2: __("goto_folder", folder.name),
|
||||
button_cancel:__("stay_here")
|
||||
});
|
||||
|
||||
}.bind(this), function(xhr){
|
||||
|
||||
console.error(xhr);
|
||||
smoke.prompt("error: " + xhr.statusText);
|
||||
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
toggle_follow_mode: function() {
|
||||
this.deselect();
|
||||
this.follow_mode = !this.follow_mode;
|
||||
|
||||
Reference in New Issue
Block a user