Merge pull request #456 from victorsl/BUG-9586

BUG 9586 "Empty folder the icon for that folder is the icon..." SOLVED
This commit is contained in:
julceslauhub
2012-08-09 14:41:50 -07:00
4 changed files with 93 additions and 66 deletions

View File

@@ -47,7 +47,7 @@
background-color: #eaeaea;
}
.x-color-palette em:hover, .x-color-palette span:hover{
.x-color-palette em:hover, .x-color-palette span:hover{
background-color: #eaeaea;
}
@@ -419,8 +419,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
background-image:url(/images/ext/gray/button/s-arrow-o.gif);
}
@@ -429,8 +429,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
background-image:url(/images/ext/gray/button/s-arrow-bo.gif);
}
@@ -1320,7 +1320,7 @@ a.x-menu-item {
.x-panel-header {
color:#333;
font-weight:bold;
font-weight:bold;
font-size: 11px;
font-family: tahoma,arial,verdana,sans-serif;
border-color:#d0d0d0;

View File

@@ -47,7 +47,7 @@
background-color: #eaeaea;
}
.x-color-palette em:hover, .x-color-palette span:hover{
.x-color-palette em:hover, .x-color-palette span:hover{
background-color: #eaeaea;
}
@@ -419,8 +419,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
background-image:url(/images/ext/gray/button/s-arrow-o.gif);
}
@@ -429,8 +429,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
background-image:url(/images/ext/gray/button/s-arrow-bo.gif);
}
@@ -1320,7 +1320,7 @@ a.x-menu-item {
.x-panel-header {
color:#333;
font-weight:bold;
font-weight:bold;
font-size: 11px;
font-family: tahoma,arial,verdana,sans-serif;
border-color:#d0d0d0;

View File

@@ -47,7 +47,7 @@
background-color: #eaeaea;
}
.x-color-palette em:hover, .x-color-palette span:hover{
.x-color-palette em:hover, .x-color-palette span:hover{
background-color: #eaeaea;
}
@@ -419,8 +419,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
background-image:url(/images/ext/gray/button/s-arrow-o.gif);
}
@@ -429,8 +429,8 @@ ul.x-tab-strip-bottom{
background-image:url(/images/ext/default/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
background-image:url(/images/ext/gray/button/s-arrow-bo.gif);
}
@@ -1320,7 +1320,7 @@ a.x-menu-item {
.x-panel-header {
color:#333;
font-weight:bold;
font-weight:bold;
font-size: 11px;
font-family: tahoma,arial,verdana,sans-serif;
border-color:#d0d0d0;

View File

@@ -72,6 +72,36 @@ streamFilefromPM=function(fileStream) {
});
};
function nodeRootCreate()
{
var node = new Ext.tree.AsyncTreeNode({
id: "root",
text: "/",
draggable: false,
expanded: true,
cls: "folder",
listeners: {
beforeload: function (nodeRoot) {
nodeRoot.setIcon("");
},
load: function (nodeRoot) {
nodeRoot.setIcon("/images/ext/default/tree/folder.gif");
},
expand: function (nodeRoot) {
if (nodeRoot.hasChildNodes()) {
nodeRoot.setIcon("/images/ext/default/tree/folder-open.gif");
}
},
collapse: function (nodeRoot) {
nodeRoot.setIcon("/images/ext/default/tree/folder.gif");
}
}
});
return node;
}
function chDir( directory, loadGridOnly ) {
// console.info("**** Changing Directory: "+directory+" --
@@ -458,8 +488,6 @@ function openActionDialog( caller, action ) {
}
function handleCallback(requestParams, node) {
// console.log("handleCallback "+requestParams +" -- "+node);
// console.trace();
var conn = new Ext.data.Connection();
conn.request({
@@ -493,6 +521,15 @@ function handleCallback(requestParams, node) {
} else {
Ext.Msg.alert( 'Failure', json.error );
}
if (options.params.option == "directory") {
switch (options.params.action) {
case "delete":
case "rename":
Ext.getCmp("dirTreePanel").setRootNode(nodeRootCreate());
break;
}
}
}
else {
Ext.Msg.alert( 'Error', 'Failed to connect to the server.');
@@ -546,27 +583,25 @@ function getRequestParams() {
* Function for actions, which don't require a form like download,
* extraction, deletion etc.
*/
function deleteFiles(btn) {
function deleteFiles(btn)
{
if (btn != "yes") {
return;
}
if( btn != 'yes') {
return;
}
requestParams = getRequestParams();
requestParams.action = 'delete';
handleCallback(requestParams);
if(requestParams.option=='documents'){
datastore.sendWhat = 'files';
loadDir();
} else {
var root1 = new Ext.tree.AsyncTreeNode({
text : '/',
draggable : false,
expanded : true,
id : 'root'
});
Ext.getCmp('dirTreePanel').setRootNode(root1);
}
requestParams = getRequestParams();
requestParams.action = "delete";
handleCallback(requestParams);
if (requestParams.option == "documents") {
datastore.sendWhat = "files";
loadDir();
} else {
//Ext.getCmp("dirTreePanel").setRootNode(nodeRootCreate());
}
}
function extractArchive(btn) {
if( btn != 'yes') {
return;
@@ -575,24 +610,21 @@ function extractArchive(btn) {
requestParams.action = 'extract';
handleCallback(requestParams);
}
function deleteDir( btn, node ) {
if( btn != 'yes') {
return;
}
requestParams = getRequestParams();
requestParams.dir = datastore.directory.substring( 0, datastore.directory.lastIndexOf('/'));
requestParams.selitems = Array( node.id.replace( /_RRR_/g, '/' ) );
requestParams.action = 'delete';
handleCallback(requestParams, node);
var root1 = new Ext.tree.AsyncTreeNode({
text : '/',
draggable : false,
expanded : true,
id : 'root'
});
Ext.getCmp('dirTreePanel').setRootNode(root1);
function deleteDir(btn, node)
{
if (btn != "yes") {
return;
}
requestParams = getRequestParams();
requestParams.dir = datastore.directory.substring(0, datastore.directory.lastIndexOf("/"));
requestParams.selitems = Array(node.id.replace(/_RRR_/g, "/"));
requestParams.action = "delete";
handleCallback(requestParams, node);
//Ext.getCmp("dirTreePanel").setRootNode(nodeRootCreate());
}
Ext.msgBoxSlider = function(){
@@ -1605,10 +1637,11 @@ var documentsTab = {
animate : true,
tools:[
{
id:'refresh',
handler:function() {
Ext.getCmp('dirTreePanel').getRootNode().reload();
}
id: "refresh",
handler: function () {
//Ext.getCmp("dirTreePanel").getRootNode().reload();
Ext.getCmp("dirTreePanel").setRootNode(nodeRootCreate());
}
}
],
// rootVisible: false,
@@ -1663,13 +1696,7 @@ var documentsTab = {
}
},
root : new Ext.tree.AsyncTreeNode({
text : '/',
draggable : false,
expanded : true,
cls: 'folder',
id : 'root'
})
root: nodeRootCreate()
},
{
layout : "border",