1-
1+
22( function ( ) {
33 var Formatters = {
44
407407 var className = 'ascending'
408408 if ( $ ( this ) . hasClass ( 'ascending' ) ) {
409409 className = 'descending' ;
410- }
410+ }
411411
412412 oWebDAV . Sort ( $ ( this ) . data ( 'sort-column' ) , className == 'ascending' ) ;
413413 } )
448448 } ,
449449
450450 _OnPopState : function ( oEvent ) {
451- if ( ! oWebDAV . GetHashValue ( 'search' ) ) {
451+ if ( oWebDAV . GetHashValue ( 'search' ) ) {
452+ oSearchForm . LoadFromHash ( ) ;
453+ }
454+ else {
452455 var sUrl = oEvent . state && oEvent . state . Url || window . location . href . split ( "#" ) [ 0 ] ;
453456 oWebDAV . NavigateFolder ( sUrl ) ;
454457 }
570573 sPath = this . CurrentFolder . Href ;
571574 }
572575
576+ //set upload url for uploader control
577+ if ( typeof WebDAVUploaderGridView !== 'undefined' ) {
578+ WebDAVUploaderGridView . SetUploadUrl ( sPath ) ;
579+ }
580+
573581 if ( sortColumn ) {
574582 this . CurrentSortColumn = sortColumn ;
575583 this . CurrentSortAscending = sortAscending ;
681689 this . SnippetPropertyName
682690 ] ;
683691
684- this . CurrentFolder . GetSearchPageByQueryAsync ( searchQuery , ( currentPageNumber - 1 ) * pageSize , pageSize , function ( oResult ) {
685- /** @type {ITHit.WebDAV.Client.AsyncResult } oResult */
692+ function _getSearchPageByQuery ( ) {
693+ oWebDAV . CurrentFolder . GetSearchPageByQueryAsync ( searchQuery , ( currentPageNumber - 1 ) * pageSize , pageSize , function ( oResult ) {
694+ /** @type {ITHit.WebDAV.Client.AsyncResult } oResult */
695+
696+ /** @type {ITHit.WebDAV.Client.HierarchyItem[] } aItems */
697+
698+ fCallback && fCallback ( oResult ) ;
699+ } ) ;
700+ }
701+
702+ if ( window . location . href . split ( "#" ) [ 0 ] != this . CurrentFolder . Href ) {
703+ this . WebDavSession . OpenFolderAsync ( window . location . href . split ( "#" ) [ 0 ] , [ ] , function ( oResponse ) {
704+ oWebDAV . CurrentFolder = oResponse . Result ;
705+ oBreadcrumbs . SetHierarchyItem ( oWebDAV . CurrentFolder ) ;
706+ _getSearchPageByQuery ( ) ;
707+ } ) ;
708+ }
709+ else {
710+ _getSearchPageByQuery ( ) ;
711+ }
686712
687- /** @type {ITHit.WebDAV.Client.HierarchyItem[] } aItems */
688713
689- fCallback && fCallback ( oResult ) ;
690- } ) ;
691714 } ,
692715
693716 Sort : function ( columnName , sortAscending ) {
776799 * Sets values to hash
777800 */
778801 SetHashValues : function ( arrayValues ) {
802+ var hashValue = '' ;
779803 var params = [ ] ;
780804 var hashConfig = this . _parseUrlHash ( ) ;
781805
787811 params . push ( key + '=' + hashConfig [ key ] ) ;
788812 }
789813
790- location . hash = params . length > 0 ? ( '#' + params . join ( '&' ) ) : '' ;
814+ hashValue = params . length > 0 ? ( '#' + params . join ( '&' ) ) : '' ;
815+
816+ if ( hashValue != location . hash ) {
817+ location . hash = hashValue ;
818+ }
791819
792820 if ( location . href [ location . href . length - 1 ] == '#' ) {
793821 oHistoryApi . PushState ( ) ;
801829 this . SetHashValues ( [ { Name : name , Value : value } ] ) ;
802830 } ,
803831
832+ /**
833+ * Returns url of app installer
834+ */
835+ GetInstallerFileUrl : function ( ) {
836+ return webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) ;
837+ } ,
838+
804839 /**
805840 * Adds name and value to array
806841 * @return {Array }
807842 */
808843 _addParameterToArray : function ( name , value , arrayParams ) {
809- var nameExist = false ;
844+ var nameExist = false ;
810845
811846 for ( var key in arrayParams ) {
812847 if ( arrayParams . hasOwnProperty ( key ) ) {
851886 * @private
852887 */
853888 _ProtocolInstallMessage : function ( ) {
889+ var installerFilePath = this . GetInstallerFileUrl ( ) ;
890+
854891 if ( ITHit . WebDAV . Client . DocManager . IsDavProtocolSupported ( ) ) {
855892 oConfirmModal . Confirm ( 'This action requires a protocol installation. <br/><br/>' +
856893 'Make sure a web browser extension is enabled after protocol installation.<br/>' +
860897 'Select OK to download the protocol installer.' , function ( ) {
861898 // IT Hit WebDAV Ajax Library protocol installers path.
862899 // Used to open non-MS Office documents or if MS Office is
863- // not installed as well as to open OS File Manager.
900+ // not installed as well as to open OS File Manager.
901+
864902
865- var installerFilePath = webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) ;
866903 window . open ( installerFilePath ) ;
867904 } , { size : 'lg' } ) ;
868905 }
888925 oWebDAV . NavigateFolder ( window . location . href . split ( "#" ) [ 0 ] ) ;
889926 }
890927
891- // Set Ajax lib version
928+ // Set Ajax lib version
892929 if ( ITHit . WebDAV . Client . DocManager . IsDavProtocolSupported ( ) ) {
893930 var $installerLink = $ ( '<a></a>' )
894931 . attr ( 'href' , webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) )
897934 } else {
898935 $ ( '.ithit-version-value' ) . text ( 'v' + ITHit . WebDAV . Client . WebDavSession . Version + ' (Protocol v' + ITHit . WebDAV . Client . WebDavSession . ProtocolVersion + ')' ) ;
899936 }
900-
901-
902937 $ ( '.ithit-current-folder-value' ) . text ( oWebDAV . GetMountUrl ( ) ) ;
903938
904939} ) ( ) ;
0 commit comments