Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
#10 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronetio committed Jan 10, 2019
1 parent 221ba87 commit ea8553f
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 51 deletions.
33 changes: 16 additions & 17 deletions dist/GanttElastic.common.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/GanttElastic.common.min.js

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions dist/GanttElastic.umd.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/GanttElastic.umd.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/vue.edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
},
"task-list-item-value-container": {
'text-align': 'center',
'width': '100%'
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/GanttElastic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function getOptions (userOptions) {
percent: 100,
width: 0,
finalWidth: 0,
minWidth: 18,
expander: {
size: 16,
columnWidth: 24,
Expand Down
12 changes: 6 additions & 6 deletions src/components/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
<div
class="gantt-elastic__main-view-container"
ref="svgChartContainer"
@mousedown.stop="chartMouseDown"
@touchstart.stop.prevent="chartMouseDown"
@mouseup.stop.prevent="chartMouseUp"
@touchend.stop.prevent="chartMouseUp"
@mousemove.stop.prevent="chartMouseMove"
@touchmove.stop.prevent="chartMouseMove"
@mousedown="chartMouseDown"
@touchstart.prevent="chartMouseDown"
@mouseup.prevent="chartMouseUp"
@touchend.prevent="chartMouseUp"
@mousemove.prevent="chartMouseMove"
@touchmove.prevent="chartMouseMove"
@wheel.prevent="chartWheel"
>
<chart></chart>
Expand Down
16 changes: 13 additions & 3 deletions src/components/TaskList/TaskListHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class="gantt-elastic__task-list-header-label"
:style="root.style('task-list-header-label',column.style['task-list-header-label'])"
:column="column"
@mouseup="resizerMouseUp($event, column)"
@mouseup="resizerMouseUp"
>{{column.label}}</div>
<div
class="gantt-elastic__task-list-header-resizer-wrapper"
Expand Down Expand Up @@ -91,18 +91,28 @@ export default {
resizerMouseMove (event) {
if (this.resizer.moving) {
this.resizer.moving.width = this.resizer.initialWidth + event.clientX - this.resizer.x;
if (this.resizer.moving.width < this.root.state.taskList.minWidth) {
this.resizer.moving.width = this.root.state.taskList.minWidth;
}
this.root.$emit("taskList-column-width-change", this.resizer.moving.width);
}
},
resizerMouseUp (event) {
if (this.resizer.moving) {
this.root.$emit("taskList-column-width-change", this.resizer.moving.width);
this.root.$emit("taskList-column-width-change-stop", this.resizer.moving.width);
this.root.$emit("taskList-column-width-change", this.resizer.moving);
this.root.$emit("taskList-column-width-change-stop", this.resizer.moving);
this.resizer.moving = false;
}
}
},
created () {
this.mouseUpListener = document.addEventListener('mouseup', (event) => {
console.log('moving');
this.resizerMouseUp(event);
});
this.mouseMoveListener = document.addEventListener('mousemove', (event) => {
this.resizerMouseMove(event);
});
this.root.$on("main-view-mousemove", this.resizerMouseMove);
this.root.$on("main-view-mouseup", this.resizerMouseUp);
}
Expand Down

0 comments on commit ea8553f

Please sign in to comment.