From 30a07e95737e3bed7be1d418c49fa9b60e160e7b Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 26 Dec 2012 13:35:22 -0500 Subject: [PATCH] Save configuration after paste events and 2 seconds after typing --- apps/files_external/js/settings.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index a3abcfebb8..f2a08ed6df 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -157,8 +157,23 @@ $(document).ready(function() { return defaultMountPoint+append; } - $('#externalStorage td').live('change', function() { - OC.MountConfig.saveStorage($(this).parent()); + $('#externalStorage td').live('paste', function() { + 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() {