Commit 3d090a41 authored by wangqinghua's avatar wangqinghua

style update

parent 57a67aa7
...@@ -550,22 +550,26 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,ca ...@@ -550,22 +550,26 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,ca
// 鼠标进入事件 // 鼠标进入事件
this.scene.mouseover(function (event) { this.scene.mouseover(function (event) {
console.log(event.target)
Timer.start() Timer.start()
// 进入某个节点 // 进入某个节点
if (event.target != null && event.target instanceof JTopo.Node && event.target.nodeTooltip && editor.stageMode !== 'edit') { if (event.target != null && event.target instanceof JTopo.Node && event.target.description && editor.stageMode !== 'edit') {
$('.node-tooltip span').html(event.target.nodeTooltip) console.log('scene.mouseover.target')
$('.node-infobox span').html(event.target.description);
// 记录鼠标触发位置在canvas中的相对位置 // 记录鼠标触发位置在canvas中的相对位置
var menuY = event.layerY ? event.layerY : event.offsetY var menuY = event.layerY ? event.layerY : event.offsetY
var menuX = event.layerX ? event.layerX : event.offsetX var menuX = event.layerX ? event.layerX : event.offsetX
// 判断边界出是否能完整显示弹出菜单 // 判断边界出是否能完整显示弹出菜单
if (menuX + $('.node-tooltip').width() >= self.stage.width) { if (menuX + $('.node-infobox').width() >= self.stage.width) {
menuX -= $('.node-tooltip').width() menuX -= $('.node-infobox').width()
} }
if (menuY + $('.node-tooltip').height() >= self.stage.height) { if (menuY + $('.node-infobox').height() >= self.stage.height) {
menuY -= $('.node-tooltip').height() menuY -= $('.node-infobox').height()
} }
$('.link-tooltip').css('display', 'none') $('.link-tooltip').css('display', 'none');
$('.node-tooltip').css({ $('.node-infobox').css({
'display': 'block', 'display': 'block',
'margin-top': menuY, 'margin-top': menuY,
'margin-left': menuX, 'margin-left': menuX,
...@@ -592,6 +596,7 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,ca ...@@ -592,6 +596,7 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,ca
'cursor': 'pointer' 'cursor': 'pointer'
}) })
} else { } else {
$('.node-infobox').css('display', 'none')
// 鼠标进入别的地方 // 鼠标进入别的地方
} }
}) })
...@@ -1381,14 +1386,14 @@ editor.utils = { ...@@ -1381,14 +1386,14 @@ editor.utils = {
}, },
// 查找节点,便居中闪动显示 // 查找节点,便居中闪动显示
findNodeAndFlash: function (text) { findNodeAndFlash: function (text) {
if (!text) return if (!text) return;
// var self = this // var self = this
text = text.trim() text = text.trim();
var nodes = editor.stage.find('node[text="' + text + '"]') var nodes = editor.stage.find('node[text="' + text + '"]')
if (nodes.length > 0) { if (nodes.length > 0) {
var node = nodes[0] var node = nodes[0];
this.unSelectAllNodeExcept(node) this.unSelectAllNodeExcept(node)
node.selected = true node.selected = true;
var location = node.getCenterLocation() var location = node.getCenterLocation()
// 查询到的节点居中显示 // 查询到的节点居中显示
editor.stage.setCenter(location.x, location.y) editor.stage.setCenter(location.x, location.y)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment