Skip to content

Commit

Permalink
Listen to paste events for dropbox configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Gapczynski committed Dec 26, 2012
1 parent 5d68e04 commit 48a3966
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions apps/files_external/js/dropbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -50,7 +61,7 @@ $(document).ready(function() {
$(tr).find('.dropbox').hide();
}
}
});
}

$('.dropbox').live('click', function(event) {
event.preventDefault();
Expand Down

0 comments on commit 48a3966

Please sign in to comment.