Changeset 17 for pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js
- Timestamp:
- Jul 1, 2014 9:23:18 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js
r16 r17 55 55 break; 56 56 case 'copy': 57 showCopyModal();58 break;59 57 case 'cut': 60 show MoveModal();58 showCopyModal(currentObj, action); 61 59 break; 62 60 default: … … 91 89 } 92 90 93 var showCopyModal = function () { 91 var showCopyModal = function (obj, action) { 92 var modalTitle = action == 'copy' ? 'Sao chép ' + (obj.type == 'directory'?'thư mục':'file') + ' [' + obj.name + ']':'Di chuyá»n ' + (obj.type == 'directory'?'thư mục':'file') + ' [' + obj.name + ']' 93 var submitTitle = action == 'copy' ? 'Sao chép' : 'Di chuyá»n'; 94 var submitIcon = action == 'copy' ? '<i class="icon-copy"></i>' : '<i class="icon-cut"></i>'; 95 96 //btn-primary 94 97 $(o.copymodal).modal('show'); 95 /*$(o.copymodal).find('INPUT#txtSelectedObj').val(currentObj.name); 96 $(o.copymodal).find('.modal-header').text('Chia sẻ ' + (currentObj.type == 'directory'?'thư mục':'file') + ' [' + currentObj.name + ']');*/ 97 } 98 99 var showMoveModal = function () { 100 $(o.movemodal).modal('show'); 98 $(o.copymodal).find('INPUT#txtSelectedObj').val(obj.name); 99 $(o.copymodal).find('.modal-header').text(modalTitle); 100 $(o.copymodal).find('.btn-primary').empty(); 101 $(o.copymodal).find('.btn-primary').append(submitIcon + "\n" + submitTitle); 102 103 var selectTree = $(o.copymodal).find('#select-destination-tree').violetTree({ 104 container: $('#select-destination-tree'), 105 expandEasing: 'easeOutBounce', 106 collapseEasing: 'easeOutBounce', 107 homeDirNameDisplay: "Thư mục gá»c", 108 contextmenuON: false 109 }); 110 111 $(o.copymodal).find('.btn-primary').button().click(function() {excuteCopy(obj, selectTree, action)}) 112 113 $(o.copymodal).on('hide.bs.modal', function () { 114 $(o.copymodal).find('.btn-primary').unbind('click'); 115 }); 116 } 117 118 var excuteCopy = function (obj, tree, action) { 119 var destObj = tree.getSelectedObj(); 120 //alert(action + ' ' + obj.type + ' ' + obj.name + ' to ' + destObj.type + ' ' + destObj.name); 121 122 //sendCommand 123 var postdata = {sourceid:obj.id, 124 sourcetype:obj.type, 125 destid: destObj.id, 126 desttype: destObj.type, 127 flag:action} 128 129 sendCommand({ 130 script:'ajax/privatecontent/copy', 131 postdata:postdata, 132 callbackSuccess: function (parsedData) { 133 if (parsedData.RESULT == true) { 134 //please add code here 135 }else return false; 136 } 137 }); 101 138 } 102 139 … … 117 154 currentObj.id = $(i).attr('rel').substring(3); 118 155 currentObj.type = $(i).find('>div>div').hasClass('icon-directory') ? 'directory':'file'; 119 console.log(currentObj.type);120 156 } 121 157 … … 229 265 } 230 266 231 this.showModal = function ( act, obj) {267 this.showModal = function (obj, act) { 232 268 switch( act ) { 233 269 case 'copy': 234 break;235 case 'move':270 case 'cut': 271 showCopyModal(obj, act); 236 272 break; 237 273 case 'share':
Note: See TracChangeset
for help on using the changeset viewer.