source: pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js @ 13

Last change on this file since 13 was 13, checked in by dungnv, 11 years ago
  • Property svn:mime-type set to text/plain
File size: 2.1 KB
Line 
1jQuery(
2        function($) {
3
4                /**
5                For resize panels on main screen
6                */
7                var maxWidth = 0;
8                function getDirTreeMaxWidth () {
9                        var scrWidth = $('#main-content').width();
10                        return parseInt(scrWidth / 2);
11                }
12
13                function layout ()
14                {
15                        var scrWidth = $('#main-content').width();
16                        var scrHeght = $(window).height();
17                        var dirTreeHeight = scrHeght - $('#title-bar').height() - $('#tools-bar').height() - $('#status-bar').height() - 2;
18
19                        $('#directory-view-container').height(dirTreeHeight);
20                        $('#directory-content-view-container').height(dirTreeHeight);
21                        $('#directory-content-view-container').width('calc(100% - ' + ($('#directory-view-container').width() + 8) + 'px)');
22                        var scollWidth = $('#directory-content-view-container').width();
23
24                        maxWidth = getDirTreeMaxWidth();
25
26                        $('#treeview-container').height(dirTreeHeight - 5);
27                }
28
29                layout ();
30
31                $('#directory-view-container').resizable({
32                        maxWidth: maxWidth,
33                        minWidth: 220,
34                        handles: "e",
35                        resize: function (event, ui) {
36                                layout ();
37                        }
38                });
39
40                $(window).resize (function() {layout ();$('#directory-view-container').resizable({maxWidth: maxWidth});});
41
42                /**
43                END - For resize panels on main screen
44                */
45
46
47                /**
48                For Directory Tree
49                */
50
51                var privateGrid = $('#file-container').violetGrid ({directoryContent:null});
52               
53                $('#main-content').violetcontextmenu({
54                                groups:{
55                                                'file':{name:'File',disabled:false},
56                                                'edit':{name:'Edit',disabled:false},
57                                                'share':{name:'Share',disabled:false}
58                                        }
59                });
60               
61                var privateTree =  $('#treeview-container').violetTree({
62                        expandEasing: 'easeOutBounce',
63                        collapseEasing: 'easeOutBounce',
64                        homeDirNameDisplay: "Thư mục gốc",
65                        grid: privateGrid
66                });
67
68                $('#btnNewFolder').click (function(){
69                        var curDir = privateTree.getCurrentDir();
70                        privateTree.createDir(curDir);
71                });
72
73                $('#btnDel').click (function() {
74                        var curDir = privateTree.getCurrentDir();
75                        privateTree.deleteDir(curDir);
76                });
77
78                $('#btnCopy').click (function(){
79                        privateTree.copy();
80                });
81
82                /**
83                END - For Directory Tree
84                */
85
86        }
87);
Note: See TracBrowser for help on using the repository browser.