Browse Source

Ok background areas seem to work fine now

v3_develop
jos 10 years ago
parent
commit
91075357ab
4 changed files with 4508 additions and 4508 deletions
  1. +4490
    -4490
      dist/vis.js
  2. +0
    -1
      lib/timeline/component/Group.js
  3. +10
    -10
      lib/timeline/component/ItemSet.js
  4. +8
    -7
      lib/timeline/component/item/BackgroundItem.js

+ 4490
- 4490
dist/vis.js
File diff suppressed because it is too large
View File


+ 0
- 1
lib/timeline/component/Group.js View File

@ -1,7 +1,6 @@
var util = require('../../util'); var util = require('../../util');
var stack = require('../Stack'); var stack = require('../Stack');
var RangeItem = require('./item/RangeItem'); var RangeItem = require('./item/RangeItem');
var DateUtil = require('../DateUtil');
/** /**
* @constructor Group * @constructor Group

+ 10
- 10
lib/timeline/component/ItemSet.js View File

@ -578,15 +578,15 @@ ItemSet.prototype._updateUngrouped = function() {
ungrouped.hide(); ungrouped.hide();
delete this.groups[UNGROUPED]; delete this.groups[UNGROUPED];
// var background = this.groups[BACKGROUND];
// for (itemId in this.items) {
// if (this.items.hasOwnProperty(itemId)) {
// item = this.items[itemId];
// if ((item instanceof BackgroundItem)) {
// background.add(item);
// }
// }
// }
for (itemId in this.items) {
if (this.items.hasOwnProperty(itemId)) {
item = this.items[itemId];
item.parent && item.parent.remove(item);
var groupId = this._getGroupId(item.data);
var group = this.groups[groupId];
group && group.add(item) || item.hide();
}
}
} }
} }
else { else {
@ -777,7 +777,7 @@ ItemSet.prototype._getType = function (itemData) {
ItemSet.prototype._getGroupId = function (itemData) { ItemSet.prototype._getGroupId = function (itemData) {
var type = this._getType(itemData); var type = this._getType(itemData);
if (type == 'background') { if (type == 'background') {
return itemData.group != undefined ? itemData.group : BACKGROUND;
return this.groupsData && itemData.group != undefined ? itemData.group : BACKGROUND;
} }
else { else {
return this.groupsData ? itemData.group : UNGROUPED; return this.groupsData ? itemData.group : UNGROUPED;

+ 8
- 7
lib/timeline/component/item/BackgroundItem.js View File

@ -1,5 +1,6 @@
var Hammer = require('../../../module/hammer'); var Hammer = require('../../../module/hammer');
var Item = require('./Item'); var Item = require('./Item');
var BackgroundGroup = require('../BackgroundGroup');
var RangeItem = require('./RangeItem'); var RangeItem = require('./RangeItem');
/** /**
@ -185,18 +186,18 @@ BackgroundItem.prototype.repositionY = function(margin) {
// and in the case of no subgroups: // and in the case of no subgroups:
else { else {
// we want backgrounds with groups to only show in groups. // we want backgrounds with groups to only show in groups.
if (this.data.group !== undefined) {
height = this.parent.height;
// same alignment for items when orientation is top or bottom
this.dom.box.style.top = this.parent.top + 'px';
this.dom.box.style.bottom = '';
}
else {
if (this.parent instanceof BackgroundGroup) {
// if the item is not in a group: // if the item is not in a group:
height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.centerContainer.height); height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.centerContainer.height);
this.dom.box.style.top = onTop ? '0' : ''; this.dom.box.style.top = onTop ? '0' : '';
this.dom.box.style.bottom = onTop ? '' : '0'; this.dom.box.style.bottom = onTop ? '' : '0';
} }
else {
height = this.parent.height;
// same alignment for items when orientation is top or bottom
this.dom.box.style.top = this.parent.top + 'px';
this.dom.box.style.bottom = '';
}
} }
this.dom.box.style.height = height + 'px'; this.dom.box.style.height = height + 'px';
}; };

Loading…
Cancel
Save