Save configuration after paste events and 2 seconds after typing

This commit is contained in:
Michael Gapczynski 2012-12-26 13:35:22 -05:00
parent a0e47a2c67
commit 30a07e9573
1 changed files with 17 additions and 2 deletions

View File

@ -157,8 +157,23 @@ $(document).ready(function() {
return defaultMountPoint+append; return defaultMountPoint+append;
} }
$('#externalStorage td').live('change', function() { $('#externalStorage td').live('paste', function() {
OC.MountConfig.saveStorage($(this).parent()); var tr = $(this).parent();
setTimeout(function() {
OC.MountConfig.saveStorage(tr);
}, 20);
});
var timer;
$('#externalStorage td').live('keyup', function() {
clearTimeout(timer);
var tr = $(this).parent();
if ($(this).val) {
timer = setTimeout(function() {
OC.MountConfig.saveStorage(tr);
}, 2000);
}
}); });
$('td.remove>img').live('click', function() { $('td.remove>img').live('click', function() {