mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Restore copy button text on directory fetch error
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
ee05e01cf4
commit
a547aff7a4
5 changed files with 13 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
4
dist/core-login.js
vendored
4
dist/core-login.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-login.js.map
vendored
2
dist/core-login.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue