Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df194dcb65 |
+4
-3
@@ -31,6 +31,7 @@ class BZgantt extends Buildoz {
|
|||||||
|
|
||||||
this.fireEvent('domConnected', { gantt: this })
|
this.fireEvent('domConnected', { gantt: this })
|
||||||
this.dayWidth = this.getBZAttribute('daywidth') || 20
|
this.dayWidth = this.getBZAttribute('daywidth') || 20
|
||||||
|
this.dayWidthPadding = 10
|
||||||
if(this.getBZAttribute('nodesfile')) this.nodesfile = this.getBZAttribute('nodesfile')
|
if(this.getBZAttribute('nodesfile')) this.nodesfile = this.getBZAttribute('nodesfile')
|
||||||
else this.initGantt()
|
else this.initGantt()
|
||||||
const dataSrc = this.getBZAttribute('src')
|
const dataSrc = this.getBZAttribute('src')
|
||||||
@@ -160,7 +161,7 @@ class BZgantt extends Buildoz {
|
|||||||
"nodeType": "bar",
|
"nodeType": "bar",
|
||||||
"id": task.id,
|
"id": task.id,
|
||||||
"coords": {
|
"coords": {
|
||||||
"x": startIdx * this.dayWidth,
|
"x": (startIdx * this.dayWidth) + (startIdx > 0 ? this.dayWidthPadding : 0),
|
||||||
"y": curY,
|
"y": curY,
|
||||||
},
|
},
|
||||||
"markup": markup
|
"markup": markup
|
||||||
@@ -211,8 +212,8 @@ class BZgantt extends Buildoz {
|
|||||||
for(let idx=0; idx<=endIdx; idx++){
|
for(let idx=0; idx<=endIdx; idx++){
|
||||||
const dayDiv = document.createElement('div')
|
const dayDiv = document.createElement('div')
|
||||||
dayDiv.classList.add('day')
|
dayDiv.classList.add('day')
|
||||||
dayDiv.style.left = `calc(var(--chart-left) + ${idx * this.dayWidth}px)`
|
dayDiv.style.left = `calc(var(--chart-left) + ${idx * (this.dayWidth + this.dayWidthPadding)}px)`
|
||||||
dayDiv.style.width = this.dayWidth + 'px'
|
dayDiv.style.width = (this.dayWidth + this.dayWidthPadding) + 'px'
|
||||||
dayDiv.innerHTML = ' ' + dayDate.getDate()
|
dayDiv.innerHTML = ' ' + dayDate.getDate()
|
||||||
if(dayDate.toISOString().substring(0,10) == (new Date()).toISOString().substring(0,10)) dayDiv.classList.add('today')
|
if(dayDate.toISOString().substring(0,10) == (new Date()).toISOString().substring(0,10)) dayDiv.classList.add('today')
|
||||||
dayDiv.setAttribute('title', new Intl.DateTimeFormat('fr-FR', {
|
dayDiv.setAttribute('title', new Intl.DateTimeFormat('fr-FR', {
|
||||||
|
|||||||
Reference in new issue
Block a user