ItEr33S08ValidacionEProbasFuncionaisItEr32S09: [Bug #79] Resizing tasks disability is enforced

This commit is contained in:
Óscar González Fernández 2009-11-02 21:23:20 +01:00
parent dda0a6c6fc
commit 739970d3f5
3 changed files with 13 additions and 1 deletions

View file

@ -228,7 +228,8 @@ public class TaskComponent extends Div implements AfterCompose {
if ("updatePosition".equals(cmdId)
&& isMovingTasksEnabled()) {
result = _updatecmd;
} else if ("updateSize".equals(cmdId)) {
} else if ("updateSize".equals(cmdId)
&& isResizingTasksEnabled()) {
result = _updatewidthcmd;
} else if ("addDependency".equals(cmdId)) {
result = _adddependencycmd;
@ -236,6 +237,10 @@ public class TaskComponent extends Div implements AfterCompose {
return result;
}
public boolean isResizingTasksEnabled() {
return disabilityConfiguration.isResizingTasksEnabled();
}
public boolean isMovingTasksEnabled() {
return disabilityConfiguration.isMovingTasksEnabled();
}

View file

@ -7,6 +7,7 @@
<div id="${self.uuid}" z.type="ganttz.task.Task" idTask="${self.id}"
z.autoz="true"${self.outerAttrs}" class="box"
movingTasksEnabled="${self.movingTasksEnabled}"
resizingTasksEnabled="${self.resizingTasksEnabled}"
onMouseover="zkTasklist.showTooltip('tasktooltip${self.uuid}');"
onMouseOut="zkTasklist.hideTooltip('tasktooltip${self.uuid}');">
<div class="completion"></div>

View file

@ -308,12 +308,18 @@ zkTask.init = function(cmp) {
return cmp.getAttribute('movingTasksEnabled') === 'true';
}
function resizingTasksEnabled() {
return cmp.getAttribute('resizingTasksEnabled') === 'true';
}
// Instead of executing the code directly, a callback is created
// that will be executed when the user passes the mouse over the task
var callback = function() {
if (movingTasksEnabled()) {
addDragSupport();
}
if(resizingTasksEnabled()) {
addResizeSupport();
}
// it removes itself, so it's not executed again:
YAHOO.util.Event.removeListener(cmp, "mouseover", callback);
}