1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

[system repo admin] fix, improvement, supplement, clean

This commit is contained in:
llj
2016-06-07 17:32:01 +08:00
committed by lian
parent a767aeb3d8
commit 8c2e16ca36
29 changed files with 615 additions and 1153 deletions

View File

@@ -31,6 +31,37 @@ define([
$.extend(this.data, options);
}
this.render();
},
events: {
'submit #libs-search-form': 'searchLibs', // for 'all' libs
'submit #trash-libs-search-form': 'searchTrashLibs'
},
// search libs by repo_name
searchLibs: function() {
var $form = this.$('#libs-search-form');
var name = $.trim($('[name="name"]', $form).val());
if (!name) {
return false;
}
var url = $form.attr('action') + '?name=' + encodeURIComponent(name) + '&owner=';
location.href = url;
return false; // necessary
},
// search trash libs by owner
searchTrashLibs: function() {
var $form = this.$('#trash-libs-search-form');
var owner = $.trim($('[name="name"]', $form).val());
if (!owner) {
return false;
}
var url = $form.attr('action') + '?name=' + encodeURIComponent(owner);
location.href = url;
return false; // necessary
}
});