Browse Source

Removed all usage of style.bottom

css_transitions
jos 10 years ago
parent
commit
610702f21e
5 changed files with 11 additions and 33 deletions
  1. +2
    -16
      src/timeline/component/TimeAxis.js
  2. +2
    -0
      src/timeline/component/css/panel.css
  3. +5
    -11
      src/timeline/component/item/ItemBox.js
  4. +1
    -3
      src/timeline/component/item/ItemPoint.js
  5. +1
    -3
      src/timeline/component/item/ItemRange.js

+ 2
- 16
src/timeline/component/TimeAxis.js View File

@ -238,14 +238,7 @@ TimeAxis.prototype._repaintMinorText = function (x, text, orientation) {
label.childNodes[0].nodeValue = text; label.childNodes[0].nodeValue = text;
if (orientation == 'top') {
label.style.top = this.props.majorLabelHeight + 'px';
label.style.bottom = '';
}
else {
label.style.top = '';
label.style.bottom = this.props.majorLabelHeight + 'px';
}
label.style.top = (orientation == 'top') ? (this.props.majorLabelHeight + 'px') : '0';
label.style.left = x + 'px'; label.style.left = x + 'px';
//label.title = title; // TODO: this is a heavy operation //label.title = title; // TODO: this is a heavy operation
}; };
@ -274,14 +267,7 @@ TimeAxis.prototype._repaintMajorText = function (x, text, orientation) {
label.childNodes[0].nodeValue = text; label.childNodes[0].nodeValue = text;
//label.title = title; // TODO: this is a heavy operation //label.title = title; // TODO: this is a heavy operation
if (orientation == 'top') {
label.style.top = '0px';
label.style.bottom = '';
}
else {
label.style.top = '';
label.style.bottom = '0px';
}
label.style.top = (orientation == 'top') ? '0' : (this.props.minorLabelHeight + 'px');
label.style.left = x + 'px'; label.style.left = x + 'px';
}; };

+ 2
- 0
src/timeline/component/css/panel.css View File

@ -55,7 +55,9 @@
width: 100%; width: 100%;
height: 1px; height: 1px;
box-shadow: 0 0 10px rgba(0,0,0,0.8); box-shadow: 0 0 10px rgba(0,0,0,0.8);
/* TODO: find a nice way to ensure shadows are drawn on top of items
z-index: 1; z-index: 1;
*/
} }
.vis.timeline .vispanel .shadow.top { .vis.timeline .vispanel .shadow.top {

+ 5
- 11
src/timeline/component/item/ItemBox.js View File

@ -211,20 +211,14 @@ ItemBox.prototype.repositionY = function() {
dot = this.dom.dot; dot = this.dom.dot;
if (orientation == 'top') { if (orientation == 'top') {
box.style.top = (this.top || 0) + 'px';
box.style.bottom = '';
line.style.top = '0';
line.style.bottom = '';
box.style.top = (this.top || 0) + 'px';
line.style.top = '0';
line.style.height = (this.parent.top + this.top + 1) + 'px'; line.style.height = (this.parent.top + this.top + 1) + 'px';
} }
else { // orientation 'bottom' else { // orientation 'bottom'
box.style.top = '';
box.style.bottom = (this.top || 0) + 'px';
line.style.top = (this.parent.top + this.parent.height - this.top - 1) + 'px';
line.style.bottom = '0';
line.style.height = '';
box.style.top = (this.parent.height - this.top - this.height || 0) + 'px';
line.style.top = (this.parent.height - this.top - 1) + 'px';
line.style.height = this.top + 'px';
} }
dot.style.top = (-this.props.dot.height / 2) + 'px'; dot.style.top = (-this.props.dot.height / 2) + 'px';

+ 1
- 3
src/timeline/component/item/ItemPoint.js View File

@ -183,10 +183,8 @@ ItemPoint.prototype.repositionY = function() {
if (orientation == 'top') { if (orientation == 'top') {
point.style.top = this.top + 'px'; point.style.top = this.top + 'px';
point.style.bottom = '';
} }
else { else {
point.style.top = '';
point.style.bottom = this.top + 'px';
point.style.top = (this.parent.height - this.top - this.height) + 'px';
} }
}; };

+ 1
- 3
src/timeline/component/item/ItemRange.js View File

@ -195,11 +195,9 @@ ItemRange.prototype.repositionY = function() {
if (orientation == 'top') { if (orientation == 'top') {
box.style.top = this.top + 'px'; box.style.top = this.top + 'px';
box.style.bottom = '';
} }
else { else {
box.style.top = '';
box.style.bottom = this.top + 'px';
box.style.top = (this.parent.height - this.top - this.height) + 'px';
} }
}; };

Loading…
Cancel
Save