aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/OC
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-02-06 16:05:13 +0100
committerLouis Chemineau <louis@chmn.me>2023-02-08 10:54:17 +0100
commita547aff7a46ad4bd05e6253515c26a5bac8e1475 (patch)
treea86b0524f13d7729024c9d38c085ff771e64f80b /core/src/OC
parentee05e01cf43c5e044c551340da650eed3e1c161c (diff)
downloadnextcloud-server-a547aff7a46ad4bd05e6253515c26a5bac8e1475.tar.gz
nextcloud-server-a547aff7a46ad4bd05e6253515c26a5bac8e1475.zip
Restore copy button text on directory fetch error
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'core/src/OC')
-rw-r--r--core/src/OC/dialogs.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js
index 286f9848290..f49d5cd4fa0 100644
--- a/core/src/OC/dialogs.js
+++ b/core/src/OC/dialogs.js
@@ -427,7 +427,7 @@ const Dialogs = {
if (checkInput()) {
var newname = $input.val()
self.filepicker.filesClient.createDirectory(self.$filePicker.data('path') + "/" + newname).always(function (status) {
- self._fillFilePicker(self.$filePicker.data('path') + "/" + newname)
+ self._fillFilePicker(self.$filePicker.data('path') + "/" + newname, type)
})
OC.hideMenus()
self.$filePicker.ocdialog('unsetEnterCallback')
@@ -459,10 +459,10 @@ const Dialogs = {
var dir = self.$filePicker.data('path')
self.filepicker.sortField = $(event.currentTarget).data('sort')
self.filepicker.sortOrder = self.filepicker.sortOrder === 'asc' ? 'desc' : 'asc'
- self._fillFilePicker(dir)
+ self._fillFilePicker(dir, type)
}
})
- self._fillFilePicker(path)
+ self._fillFilePicker(path, type)
})
// build buttons
@@ -1120,7 +1120,7 @@ const Dialogs = {
/**
* fills the filepicker with files
*/
- _fillFilePicker: async function(dir) {
+ _fillFilePicker: async function(dir, type) {
var self = this
this.$filelist.empty()
this.$filePicker.find('.emptycontent').hide()
@@ -1155,6 +1155,7 @@ const Dialogs = {
console.error('Requested path does not exists, falling back to root')
var files = await getFolderContents('/')
this.$filePicker.data('path', '/')
+ this._changeButtonsText(type, '')
}
self.filelist = files
@@ -1320,7 +1321,7 @@ const Dialogs = {
_handleTreeListSelect: function(event, type) {
var self = event.data
var dir = $(event.target).closest('.crumb').data('dir')
- self._fillFilePicker(dir)
+ self._fillFilePicker(dir, type)
var getOcDialog = (event.target).closest('.oc-dialog')
var buttonEnableDisable = $('.primary', getOcDialog)
this._changeButtonsText(type, dir.split(/[/]+/).pop())
@@ -1343,7 +1344,7 @@ const Dialogs = {
$element.toggleClass('filepicker_element_selected')
buttonEnableDisable.prop('disabled', false)
} else if ($element.data('type') === 'dir') {
- this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname'))
+ this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname'), type)
this._changeButtonsText(type, $element.data('entryname'))
if (this.$filePicker.data('mimetype').indexOf('httpd/unix-directory') !== -1 || this.$filePicker.data('allowDirectoryChooser')) {
buttonEnableDisable.prop('disabled', false)