From 48a3966ea979a56e9277f588d6001c47e8a9c606 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 26 Dec 2012 14:04:02 -0500 Subject: Listen to paste events for dropbox configuration --- apps/files_external/js/dropbox.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/files_external/js/dropbox.js b/apps/files_external/js/dropbox.js index cc6a37d0511..824c47d9f6d 100644 --- a/apps/files_external/js/dropbox.js +++ b/apps/files_external/js/dropbox.js @@ -36,9 +36,20 @@ $(document).ready(function() { } }); - $('#externalStorage tbody tr input').live('keyup', function() { - var tr = $(this).parent().parent(); - if ($(tr).hasClass('OC_Filestorage_Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') { + $('#externalStorage tbody tr.OC_Filestorage_Dropbox td').live('paste', function() { + var tr = $(this).parent(); + setTimeout(function() { + showButton(tr); + }, 20); + }); + + $('#externalStorage tbody tr.OC_Filestorage_Dropbox td').live('keyup', function() { + showButton($(this).parent().parent()); + + }); + + function showButton(tr) { + if ($(tr).find('[data-parameter="configured"]').val() != 'true') { var config = $(tr).find('.configuration'); if ($(tr).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '') { if ($(tr).find('.dropbox').length == 0) { @@ -50,7 +61,7 @@ $(document).ready(function() { $(tr).find('.dropbox').hide(); } } - }); + } $('.dropbox').live('click', function(event) { event.preventDefault(); -- cgit v1.2.3