@@ -153,14 +153,14 @@ NAV BAR CONTROLS
153
153
//////////////////////////////////////////////////
154
154
// Go to parent directory event from file tree
155
155
//////////////////////////////////////////////////
156
- $ ( '.qv-modal-body' ) . on ( 'click' , '.qv-filetree -up' , function ( e ) {
156
+ $ ( '.qv-modal-body' ) . on ( 'click' , '.qv-go -up' , function ( e ) {
157
157
if ( currentDirectory . length > 0 && currentDirectory . indexOf ( '/' ) == - 1 ) {
158
158
currentDirectory = '' ;
159
159
} else {
160
160
currentDirectory = currentDirectory . replace ( / \/ [ ^ \/ ] + \/ ? $ / , '' ) ;
161
161
}
162
162
loadFileTree ( currentDirectory ) ;
163
- } ) ;
163
+ } ) ;
164
164
165
165
//////////////////////////////////////////////////
166
166
// Zoom values event
@@ -681,8 +681,8 @@ function loadFileTree(dir) {
681
681
// clear tree list from previous data
682
682
$ ( '#qv-modal-filebroswer tbody' ) . html (
683
683
'<tr>' +
684
- '<td class="text-center"><i class="fa fa-level-up"></i></td>' +
685
- '<td class="qv-filetree-up">...</td>' +
684
+ '<td class="text-center qv-go-up "><i class="fa fa-level-up"></i></td>' +
685
+ '<td class="qv-filetree-up qv-go-up ">...</td>' +
686
686
'<td></td>' +
687
687
'<td></td>' +
688
688
'</tr>' ) ;
@@ -702,7 +702,7 @@ function loadFileTree(dir) {
702
702
new_size = ( Math . round ( ( size / 1024 ) * 100 ) / 100 ) + ' KB' ;
703
703
}
704
704
// document format
705
- var docFormat = ( getDocumentFormat ( name ) == undefined ) ? 'fa-folder' : getDocumentFormat ( name ) ;
705
+ var docFormat = ( getDocumentFormat ( name , elem . isDirectory ) == undefined ) ? 'fa-folder' : getDocumentFormat ( name , elem . isDirectory ) ;
706
706
// append document
707
707
$ ( '.qv-modal-table tbody' ) . append (
708
708
'<tr>' +
@@ -974,17 +974,22 @@ function appendHtmlContent(pageNumber, documentName, prefix, width, height){
974
974
/**
975
975
* Get document format (type)
976
976
* @param {string } filename - document name
977
+ * @param {boolean } isDirectory - define if the current element is directory or file
977
978
*/
978
- function getDocumentFormat ( filename ) {
979
- if ( typeof map [ filename . split ( '.' ) . pop ( ) . toLowerCase ( ) ] == "undefined" ) {
980
- if ( filename . split ( '.' ) . length > 1 ) {
981
- return map [ "unknown" ] ;
979
+ function getDocumentFormat ( filename , isDirectory ) {
980
+ if ( ! isDirectory ) {
981
+ if ( typeof map [ filename . split ( '.' ) . pop ( ) . toLowerCase ( ) ] == "undefined" ) {
982
+ if ( filename . split ( '.' ) . length > 1 ) {
983
+ return map [ "unknown" ] ;
984
+ } else {
985
+ return map [ "folder" ] ;
986
+ }
982
987
} else {
983
- return map [ "folder" ] ;
988
+ return map [ filename . split ( '.' ) . pop ( ) . toLowerCase ( ) ] ;
984
989
}
985
- } else {
986
- return map [ filename . split ( '.' ) . pop ( ) . toLowerCase ( ) ] ;
987
- }
990
+ } else {
991
+ return map [ "folder" ] ;
992
+ }
988
993
}
989
994
990
995
/**
0 commit comments