1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Web/Views/AddSeries/RootDir.cshtml
2011-07-01 13:28:53 -07:00

48 lines
1.3 KiB
Plaintext

<div>
<input id="rootDirInput" type="text" style="width: 400px" />
<button id="saveDir">
Add</button>
</div>
<div id="rootDirs">
@{Html.RenderAction("RootList");}
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
$.ajaxSetup({
cache: false
});
bindFolderAutoComplete('#rootDirInput');
$('#rootDirInput').watermark('Start typing to add new root folder...');
$('#rootDirs .actionButton img').live('click',
function(image) {
var path = $(image.srcElement).attr('id');
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function() {
refreshRoot();
});
});
$('#saveDir').click(saveRootDir);
function saveRootDir() {
var path = $("#rootDirInput").val();
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function() {
refreshRoot();
$("#rootDirInput").val('');
});
}
function refreshRoot() {
$.get('@Url.Action("RootList", "AddSeries")', function(data) {
$('#rootDirs').html(data);
});
}
});
</script>