diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-18 17:22:29 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-18 17:22:29 +0200 |
commit | 7bd5e89f8cf6e46daa45e588d9275728b93a230e (patch) | |
tree | db8885541d4db473d5dbc8df86520c2aea15153c /core | |
parent | 12ff268e607738b03125ec6b212708391496d7f5 (diff) | |
download | nextcloud-server-7bd5e89f8cf6e46daa45e588d9275728b93a230e.tar.gz nextcloud-server-7bd5e89f8cf6e46daa45e588d9275728b93a230e.zip |
simplify conflict template handling, fix reopen after ESC
Diffstat (limited to 'core')
-rw-r--r-- | core/js/oc-dialogs.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 28bd94b9b0f..c4d1f34a094 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -281,8 +281,8 @@ var OCdialogs = { var addConflict = function(conflicts, original, replacement) { - var conflict = conflicts.find('.conflict.template').clone(); - + var conflict = conflicts.find('.template').clone().removeClass('template').addClass('conflict'); + conflict.data('data',data); conflict.find('.filename').text(original.name); @@ -306,7 +306,6 @@ var OCdialogs = { }); } ); - conflict.removeClass('template'); conflicts.append(conflict); //set more recent mtime bold @@ -343,7 +342,7 @@ var OCdialogs = { var conflicts = $(dialog_id+ ' .conflicts'); addConflict(conflicts, original, replacement); - var title = t('files','{count} file conflicts',{count:$(dialog_id+ ' .conflict:not(.template)').length}); + var title = t('files','{count} file conflicts',{count:$(dialog_id+ ' .conflict').length}); $(dialog_id).parent().children('.oc-dialog-title').text(title); //recalculate dimensions @@ -371,7 +370,6 @@ var OCdialogs = { text: t('core', 'Cancel'), classes: 'cancel', click: function(){ - self._fileexistsshown = false; if ( typeof controller.onCancel !== 'undefined') { controller.onCancel(data); } @@ -382,9 +380,8 @@ var OCdialogs = { text: t('core', 'Continue'), classes: 'continue', click: function(){ - self._fileexistsshown = false; if ( typeof controller.onContinue !== 'undefined') { - controller.onContinue($(dialog_id + ' .conflict:not(.template)')); + controller.onContinue($(dialog_id + ' .conflict')); } $(dialog_id).ocdialog('close'); } @@ -397,6 +394,7 @@ var OCdialogs = { buttons: buttonlist, closeButton: null, close: function(event, ui) { + self._fileexistsshown = false; $(this).ocdialog('destroy').remove(); } }); @@ -405,11 +403,11 @@ var OCdialogs = { //add checkbox toggling actions $(dialog_id).find('.allnewfiles').on('click', function() { - var checkboxes = $(dialog_id).find('.conflict:not(.template) .replacement input[type="checkbox"]'); + var checkboxes = $(dialog_id).find('.conflict .replacement input[type="checkbox"]'); checkboxes.prop('checked', $(this).prop('checked')); }); $(dialog_id).find('.allexistingfiles').on('click', function() { - var checkboxes = $(dialog_id).find('.conflict:not(.template) .original input[type="checkbox"]'); + var checkboxes = $(dialog_id).find('.conflict .original input[type="checkbox"]'); checkboxes.prop('checked', $(this).prop('checked')); }); $(dialog_id).find('.conflicts').on('click', '.replacement,.original', function() { @@ -423,8 +421,8 @@ var OCdialogs = { //update counters $(dialog_id).on('click', '.replacement,.allnewfiles', function() { - var count = $(dialog_id).find('.conflict:not(.template) .replacement input[type="checkbox"]:checked').length; - if (count === $(dialog_id+ ' .conflict:not(.template)').length) { + var count = $(dialog_id).find('.conflict .replacement input[type="checkbox"]:checked').length; + if (count === $(dialog_id+ ' .conflict').length) { $(dialog_id).find('.allnewfiles').prop('checked', true); $(dialog_id).find('.allnewfiles + .count').text(t('files','(all selected)')); } else if (count > 0) { @@ -436,8 +434,8 @@ var OCdialogs = { } }); $(dialog_id).on('click', '.original,.allexistingfiles', function(){ - var count = $(dialog_id).find('.conflict:not(.template) .original input[type="checkbox"]:checked').length; - if (count === $(dialog_id+ ' .conflict:not(.template)').length) { + var count = $(dialog_id).find('.conflict .original input[type="checkbox"]:checked').length; + if (count === $(dialog_id+ ' .conflict').length) { $(dialog_id).find('.allexistingfiles').prop('checked', true); $(dialog_id).find('.allexistingfiles + .count').text(t('files','(all selected)')); } else if (count > 0) { |