Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore copy button text on directory fetch error #36564

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions core/src/OC/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.