-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Tooltip on item update time #2247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!! This is fabulous!
Maybe you can change these small details and then we have a cool new feature!
@@ -90,6 +90,16 @@ | |||
padding: 5px; | |||
} | |||
|
|||
.vis-item .vis-onUpdateTime-tooltip { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add text-align: center
and white-space: nowrap
, make it autosize and remove the double background
:
.vis-item .vis-onUpdateTime-tooltip {
position: absolute;
color: white;
width: auto;
background: #4f81bd;
padding: 5px;
border-radius: 1px;
text-align: center;
white-space: nowrap;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
* @protected | ||
*/ | ||
Item.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) { | ||
if (!this.options.tooltipOnItemUpdateTime) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a semicolon at the end of the line. Without it the code is more error-prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
maxHeight: 400, | ||
start: new Date(), | ||
end: new Date(1000*60*60*24 + (new Date()).valueOf()), | ||
tooltipOnItemUpdateTime: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really would like to see the new template
option here to show how it works. Can you please add an simple example!?
<td>Show a tooltip on updating an item's time. Note: <code>editable.updateTime</code> must be <code>true</code></td> | ||
</tr> | ||
<tr parent="tooltipOnItemUpdateTime" class="hidden"> | ||
<td class="indent">template</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already is a option template
. Maybe we should call it tooltipTemplate
or hoverTemplate
or something like this? I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's in the tooltipOnItemUpdateTime
so I don't think we need to change the name.
|
||
<script> | ||
|
||
// create groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would prefer a much more simple example without groups and stuff. Just something like the basicExample.
|
||
// specify options | ||
var options = { | ||
orientation: 'top', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only should change options that are necessary to show the new feature.
|
||
<script src="../../../dist/vis.js"></script> | ||
<link href="../../../dist/vis.css" rel="stylesheet" type="text/css" /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be nice to demonstrate also how to overwrite the tooltip style. e.g. with something simple like:
.vis-item .vis-onUpdateTime-tooltip {
border-radius: 4px;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea! done
@yotamberk Thanks! Thats a nice new feature! |
see #1506