Fix file navigator to properly show drives in Windows. Fixes #1665
parent
cd3b938179
commit
3dace5ff22
|
@ -249,8 +249,7 @@ class Filemanager(object):
|
||||||
)
|
)
|
||||||
self.dir = get_storage_directory()
|
self.dir = get_storage_directory()
|
||||||
|
|
||||||
if ((self.dir is not None and isinstance(self.dir, list)) or
|
if (self.dir is not None and isinstance(self.dir, list)):
|
||||||
self.dir is None):
|
|
||||||
self.dir = ""
|
self.dir = ""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -568,7 +567,7 @@ class Filemanager(object):
|
||||||
'Code': 1
|
'Code': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
# check if it's dir
|
# check if it's dir
|
||||||
if old[-1] == '/':
|
if old[-1] == '/':
|
||||||
old = old[:-1]
|
old = old[:-1]
|
||||||
|
@ -620,7 +619,7 @@ class Filemanager(object):
|
||||||
'Code': 1
|
'Code': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
orig_path = "{0}{1}".format(dir, path)
|
orig_path = "{0}{1}".format(dir, path)
|
||||||
|
|
||||||
err_msg = ''
|
err_msg = ''
|
||||||
|
@ -653,7 +652,7 @@ class Filemanager(object):
|
||||||
'Code': 1
|
'Code': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
err_msg = ''
|
err_msg = ''
|
||||||
code = 1
|
code = 1
|
||||||
try:
|
try:
|
||||||
|
@ -674,14 +673,13 @@ class Filemanager(object):
|
||||||
'Error': err_msg,
|
'Error': err_msg,
|
||||||
'Code': code
|
'Code': code
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def is_file_exist(self, path, name, req=None):
|
def is_file_exist(self, path, name, req=None):
|
||||||
"""
|
"""
|
||||||
Checks whether given file exists or not
|
Checks whether given file exists or not
|
||||||
"""
|
"""
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
err_msg = ''
|
err_msg = ''
|
||||||
code = 1
|
code = 1
|
||||||
name = unquote(name)
|
name = unquote(name)
|
||||||
|
@ -733,7 +731,7 @@ class Filemanager(object):
|
||||||
'Code': 1
|
'Code': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
newName = name
|
newName = name
|
||||||
if dir != "":
|
if dir != "":
|
||||||
newPath = dir + '/' + path + newName + '/'
|
newPath = dir + '/' + path + newName + '/'
|
||||||
|
@ -775,7 +773,7 @@ class Filemanager(object):
|
||||||
'Code': 1
|
'Code': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = self.dir
|
dir = self.dir if self.dir is not None else ''
|
||||||
orig_path = "{0}{1}".format(dir, path)
|
orig_path = "{0}{1}".format(dir, path)
|
||||||
name = path.split('/')[-1]
|
name = path.split('/')[-1]
|
||||||
content = open(orig_path, 'r')
|
content = open(orig_path, 'r')
|
||||||
|
|
|
@ -1488,8 +1488,7 @@ if (has_capability(data, 'upload')) {
|
||||||
setTimeout(function() {}, 10000);
|
setTimeout(function() {}, 10000);
|
||||||
},
|
},
|
||||||
success: function(file, response) {
|
success: function(file, response) {
|
||||||
var response = jQuery.parseJSON(response),
|
var data = response.data.result,
|
||||||
data = response.data.result,
|
|
||||||
$this = $(file.previewTemplate);
|
$this = $(file.previewTemplate);
|
||||||
|
|
||||||
if (data.Code == 0) {
|
if (data.Code == 0) {
|
||||||
|
|
Loading…
Reference in New Issue