Skip to content

Commit dc58bd2

Browse files
committed
chore(demo): Update vendor.js
1 parent c017faf commit dc58bd2

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

demo/dist/scripts/vendor.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51697,6 +51697,10 @@ Github: https://github.com/angular-gantt/angular-gantt.git
5169751697
};
5169851698
}
5169951699

51700+
api.registerEvent('tasks', 'draw');
51701+
api.registerEvent('tasks', 'drawBegin');
51702+
api.registerEvent('tasks', 'drawEnd');
51703+
5170051704
var newTaskModel = function(row) {
5170151705
if (row.model.drawTask && angular.isFunction(row.model.drawTask.taskFactory)) {
5170251706
return row.model.drawTask.taskFactory();
@@ -51721,6 +51725,23 @@ Github: https://github.com/angular-gantt/angular-gantt.git
5172151725
directiveScope.row.updateVisibleTasks();
5172251726

5172351727
directiveScope.row.$scope.$digest();
51728+
51729+
return task;
51730+
};
51731+
51732+
var addEventListeners = function(task) {
51733+
var raiseDrawEvent = function() {
51734+
directiveScope.row.rowsManager.gantt.api.tasks.raise.draw(task);
51735+
};
51736+
51737+
directiveScope.row.rowsManager.gantt.api.tasks.raise.drawBegin(task);
51738+
51739+
document.on('mousemove', raiseDrawEvent);
51740+
51741+
document.one('mouseup', function() {
51742+
directiveScope.row.rowsManager.gantt.api.tasks.raise.drawEnd(task);
51743+
document.off('mousemove', raiseDrawEvent);
51744+
});
5172451745
};
5172551746

5172651747
var deferDrawing = function(startX) {
@@ -51729,12 +51750,13 @@ Github: https://github.com/angular-gantt/angular-gantt.git
5172951750

5173051751
if (Math.abs(startX - currentX) >= scope.moveThreshold) {
5173151752
element.off('mousemove', moveTrigger);
51732-
addNewTask(startX);
51753+
var task = addNewTask(startX);
51754+
addEventListeners(task);
5173351755
}
5173451756
};
5173551757

5173651758
element.on('mousemove', moveTrigger);
51737-
document.on('mouseup', function() {
51759+
document.one('mouseup', function() {
5173851760
element.off('mousemove', moveTrigger);
5173951761
});
5174051762
};
@@ -51749,12 +51771,13 @@ Github: https://github.com/angular-gantt/angular-gantt.git
5174951771
}
5175051772

5175151773
var enabledValue = utils.firstProperty([rowDrawTask], 'enabled', scope.enabled);
51752-
var enabled = angular.isFunction(enabledValue) ? enabledValue(evt): enabledValue;
51774+
var enabled = angular.isFunction(enabledValue) ? enabledValue(evt, directiveScope.row) : enabledValue;
5175351775
if (enabled && evtTarget.className.indexOf('gantt-row') > -1) {
5175451776
var x = mouseOffset.getOffset(evt).x;
5175551777

5175651778
if (scope.moveThreshold === 0) {
51757-
addNewTask(x, x);
51779+
var task = addNewTask(x);
51780+
addEventListeners(task);
5175851781
} else {
5175951782
deferDrawing(x);
5176051783
}

0 commit comments

Comments
 (0)