summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-10-08 12:27:33 +0200
committerVincent Petry <pvince81@owncloud.com>2015-10-08 12:27:33 +0200
commitcba1aae0736c0b1022561a8834a008496711c67a (patch)
treed9e8b8a9d3caab237098263573602a76fcedf25d /core
parentcd818e7419fb39d97683ecc5803534b0ed632596 (diff)
downloadnextcloud-server-cba1aae0736c0b1022561a8834a008496711c67a.tar.gz
nextcloud-server-cba1aae0736c0b1022561a8834a008496711c67a.zip
Disable "Continue" button in conflict dialog when no selection
Diffstat (limited to 'core')
-rw-r--r--core/js/oc-dialogs.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 7af50c4ddfc..b5c87084e27 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -601,6 +601,14 @@ var OCdialogs = {
$(dialogId).css('height','auto');
+ var $primaryButton = $dlg.closest('.oc-dialog').find('button.continue');
+ $primaryButton.prop('disabled', true);
+
+ function updatePrimaryButton() {
+ var checkedCount = $dlg.find('th .checkbox:checked').length;
+ $primaryButton.prop('disabled', checkedCount === 0);
+ }
+
//add checkbox toggling actions
$(dialogId).find('.allnewfiles').on('click', function() {
var $checkboxes = $(dialogId).find('.conflict .replacement input[type="checkbox"]');
@@ -632,6 +640,7 @@ var OCdialogs = {
$(dialogId).find('.allnewfiles').prop('checked', false);
$(dialogId).find('.allnewfiles + .count').text('');
}
+ updatePrimaryButton();
});
$(dialogId).on('click', '.original,.allexistingfiles', function(){
var count = $(dialogId).find('.conflict .original input[type="checkbox"]:checked').length;
@@ -646,7 +655,9 @@ var OCdialogs = {
$(dialogId).find('.allexistingfiles').prop('checked', false);
$(dialogId).find('.allexistingfiles + .count').text('');
}
+ updatePrimaryButton();
});
+
dialogDeferred.resolve();
})
.fail(function() {