45 lines
1.1 KiB
HTML
45 lines
1.1 KiB
HTML
|
|
|
|
<script>
|
|
|
|
function updateFolders(data) {
|
|
$("#sys-folders-select").load( "/partials/sys/folders-select.html", null, function() {
|
|
checkFolderSelect();
|
|
});
|
|
}
|
|
|
|
function postData( url, data, success )
|
|
{
|
|
var jqxhr = $.ajax({
|
|
type: 'POST',
|
|
url: url,
|
|
data: JSON.stringify( data ),
|
|
contentType: 'application/json',
|
|
dataType: 'json',
|
|
});
|
|
jqxhr.complete(success);
|
|
}
|
|
|
|
function checkFolderSelect()
|
|
{
|
|
$(".sys-select-folder").on("click", function(evt){
|
|
var jdata = { folder: $(this).text()};
|
|
postData("/project/sys/get_folder", jdata, updateFolders);
|
|
});
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(".drive-select").on("click", function(evt){
|
|
console.log($(this).attr("data"));
|
|
var jdata = { drive: $(this).attr("data")};
|
|
postData("/project/sys/get_drive", jdata, updateFolders);
|
|
evt.preventDefault();
|
|
});
|
|
|
|
$("#sys-folders-select").load( "/partials/sys/folders-select.html", null, function() {
|
|
checkFolderSelect();
|
|
});
|
|
});
|
|
|
|
</script> |