[Bug #1215] Store the labels hidden/shown state in the TaskRow widget and use that state when redrawing the TaskComponents.

FEA: ItEr75S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2011-10-31 17:04:58 +01:00
parent e3fe3f1a27
commit 25b367cccb
4 changed files with 20 additions and 2 deletions

View file

@ -213,6 +213,12 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
hideResourceTooltip : function(){
jq('#'+ this.uuid + ' .task-resources').hide();
},
showLabels : function(){
jq('.task-labels',this.$n()).show();
},
hideLabels : function(){
jq('.task-labels',this.$n()).hide();
},
setClass : function(cssClass){
jq(this.$n()).addClass(cssClass);
}

View file

@ -6,7 +6,8 @@ ganttz.TaskList = zk.$extends(zk.Widget, {
this.$class.setInstance(this);
},
showAllTaskLabels : function(){
jq('.task-labels').css('display','inline');
for(var child = this.firstChild; child; child = child.nextSibling)
child.showLabels();
},
hideAllTaskLabels : function(){
jq('.task-labels').css('display','none');

View file

@ -1,6 +1,15 @@
zk.$package("ganttz");
ganttz.TaskRow = zk.$extends(zk.Widget, {
_labelsHidden : true,
showLabels : function(){
this._labelsHidden = false;
this.firstChild.showLabels();
},
hideLabels : function(){
this._labelsHidden = true;
this.firstChild.hideLabels();
},
hideResourceTooltip : function(){
this.firstChild.hideResourceTooltip();
},

View file

@ -3,7 +3,9 @@ function(out){
' z.type="ganttz.task.Task" idTask="', this.id,'"',
' class="box" >');
out.push('<div class="task-labels">', this.getLabelsText(),'</div>');
out.push('<div class="task-labels" ',
this.parent._labelsHidden?'>':'style="display:block;">',
this.getLabelsText(),'</div>');
out.push('<div class="task-resources">');
out.push('<div class="task-resources-inner">', this.getResourcesText(),'</div>');
out.push('</div>');