@ -10,6 +10,7 @@ var BoxItem = require('./item/BoxItem');
var PointItem = require ( './item/PointItem' ) ;
var PointItem = require ( './item/PointItem' ) ;
var RangeItem = require ( './item/RangeItem' ) ;
var RangeItem = require ( './item/RangeItem' ) ;
var BackgroundItem = require ( './item/BackgroundItem' ) ;
var BackgroundItem = require ( './item/BackgroundItem' ) ;
import Popup from '../../shared/Popup' ;
var UNGROUPED = '__ungrouped__' ; // reserved group id for ungrouped items
var UNGROUPED = '__ungrouped__' ; // reserved group id for ungrouped items
@ -1872,6 +1873,20 @@ ItemSet.prototype._onSelectItem = function (event) {
ItemSet . prototype . _onMouseOver = function ( event ) {
ItemSet . prototype . _onMouseOver = function ( event ) {
var item = this . itemFromTarget ( event ) ;
var item = this . itemFromTarget ( event ) ;
if ( ! item ) return ;
if ( ! item ) return ;
if ( item . getTitle ( ) ) {
if ( item . popup == null ) {
item . setPopup ( new Popup ( this . body . dom . root ) ) ;
}
var container = this . body . dom . centerContainer ;
item . popup . setPosition (
event . clientX - util . getAbsoluteLeft ( container ) ,
event . clientY - util . getAbsoluteTop ( container )
) ;
item . popup . show ( ) ;
}
this . body . emitter . emit ( 'itemover' , {
this . body . emitter . emit ( 'itemover' , {
item : item . id ,
item : item . id ,
event : util . elementsCensor ( event )
event : util . elementsCensor ( event )
@ -1880,6 +1895,11 @@ ItemSet.prototype._onMouseOver = function (event) {
ItemSet . prototype . _onMouseOut = function ( event ) {
ItemSet . prototype . _onMouseOut = function ( event ) {
var item = this . itemFromTarget ( event ) ;
var item = this . itemFromTarget ( event ) ;
if ( ! item ) return ;
if ( ! item ) return ;
if ( item . popup != null ) {
item . popup . hide ( ) ;
}
this . body . emitter . emit ( 'itemout' , {
this . body . emitter . emit ( 'itemout' , {
item : item . id ,
item : item . id ,
event : util . elementsCensor ( event )
event : util . elementsCensor ( event )