Browse Source

Fixed a bug with margin.item=0 and margin.axis=0. Clarified some options in the documentation

css_transitions
josdejong 10 years ago
parent
commit
785096c51a
4 changed files with 22 additions and 6 deletions
  1. +7
    -1
      HISTORY.md
  2. +11
    -2
      docs/timeline.html
  3. +2
    -2
      src/timeline/component/ItemSet.js
  4. +2
    -1
      src/timeline/component/css/item.css

+ 7
- 1
HISTORY.md View File

@ -2,7 +2,7 @@ vis.js history
http://visjs.org http://visjs.org
## 2014-03-05, version 0.6.1
## 2014-03-06, version 0.6.1
### Graph ### Graph
@ -11,6 +11,12 @@ http://visjs.org
- Tweaked graphviz example physics. - Tweaked graphviz example physics.
- Updated physics documentation to stress importance of configurePhysics. - Updated physics documentation to stress importance of configurePhysics.
### Timeline
- Fixed a bug with options `margin.axis` and `margin.item` being ignored when setting them to zero.
- Some clarifications in the documentation.
## 2014-03-05, version 0.6.0 ## 2014-03-05, version 0.6.0
### Graph ### Graph

+ 11
- 2
docs/timeline.html View File

@ -310,7 +310,10 @@ var groups = [
<pre class="prettyprint lang-js"> <pre class="prettyprint lang-js">
var options = { var options = {
width: '100%', width: '100%',
height: '30px'
height: '30px',
margin: {
item: 20
}
}; };
</pre> </pre>
@ -476,7 +479,13 @@ var options = {
<td>Number</td> <td>Number</td>
<td>5</td> <td>5</td>
<td>The padding of items, needed to correctly calculate the size <td>The padding of items, needed to correctly calculate the size
of item ranges. Must correspond with the css of item ranges.</td>
of item ranges. Must correspond with the css of items, for example when setting <code>options.padding=10</code>, corresponding css is:
<pre class="prettyprint lang-css">
.vis.timeline .item {
padding: 10px;
}
</pre>
</td>
</tr> </tr>
<tr> <tr>

+ 2
- 2
src/timeline/component/ItemSet.js View File

@ -446,8 +446,8 @@ ItemSet.prototype.getAxis = function getAxis() {
ItemSet.prototype.reflow = function reflow () { ItemSet.prototype.reflow = function reflow () {
var changed = 0, var changed = 0,
options = this.options, options = this.options,
marginAxis = options.margin && options.margin.axis || this.defaultOptions.margin.axis,
marginItem = options.margin && options.margin.item || this.defaultOptions.margin.item,
marginAxis = (options.margin && 'axis' in options.margin) ? options.margin.axis : this.defaultOptions.margin.axis,
marginItem = (options.margin && 'item' in options.margin) ? options.margin.item : this.defaultOptions.margin.item,
update = util.updateProperty, update = util.updateProperty,
asNumber = util.option.asNumber, asNumber = util.option.asNumber,
asSize = util.option.asSize, asSize = util.option.asSize,

+ 2
- 1
src/timeline/component/css/item.css View File

@ -47,7 +47,8 @@
background: none; background: none;
} }
.vis.timeline .dot {
.vis.timeline .dot,
.vis.timeline .item.dot {
padding: 0; padding: 0;
border: 5px solid #97B0F8; border: 5px solid #97B0F8;
position: absolute; position: absolute;

Loading…
Cancel
Save