Commit 6a8d86c2 authored by techird's avatar techird

compalitity && navigator bug fix

parent 7a40b781
......@@ -242,7 +242,8 @@
var e = stack.indexOf(' at ') !== -1 ? ' at ' : '@';
while (stack.indexOf(e) !== -1)
stack = stack.substring(stack.indexOf(e) + e.length);
stack = stack.substring(0, stack.indexOf(':', stack.indexOf(':')+1));
stack = stack.substring(stack.indexOf('http'), stack.indexOf(':', stack.indexOf(':')+1));
return getScriptFromURL(stack);
};
......
Subproject commit f8625b0e6a7076259773a90ab4f24411aca5e71a
Subproject commit a830f3ce3dc62a8f4cf64611045f51453a9095ac
Subproject commit 96010a3eab9b6a3d76a94c1afe1aba09fa5770ea
Subproject commit 041d47f13cbf19a60baee2a6640b06851e44761f
......@@ -15,7 +15,7 @@ KityMinder.registerLayout('mind', kity.createClass({
rightLayout.doLayout(node, right);
var box = node.getContentBox();
node.setVertexOut(box.cx, box.cy);
node.setVertexOut(new kity.Point(box.cx, box.cy));
node.setLayoutVectorOut(new kity.Vector(0, 0));
},
......
......@@ -66,8 +66,9 @@ var ViewDragger = kity.createClass("ViewDragger", {
height: minder.getRenderTarget().clientHeight
};
var m = this.getMovement();
var box = new kity.Box(-m.x, -m.y, c.width, c.height);
return box;
var box = new kity.Box(0, 0, c.width, c.height);
var viewMatrix = minder.getPaper().getViewPortMatrix();
return viewMatrix.inverse().translate(-m.x, -m.y).transformBox(box);
},
_bind: function() {
......
......@@ -58,7 +58,9 @@ KityMinder.registerModule('Zoom', function() {
timeline.pause();
}
timeline = animator.start(minder, 300, 'easeInOutSine', function() {});
minder.fire('viewchange');
timeline.on('finish', function() {
minder.fire('viewchange');
});
}
var ZoomCommand = kity.createClass('Zoom', {
......
......@@ -52,7 +52,6 @@ KityMinder.registerUI('contextmenu', function(minder) {
var $li = $('<li>')
.addClass('fui-item')
.append(label)
.data('menu', item)
.appendTo($menu);
......@@ -71,6 +70,8 @@ KityMinder.registerUI('contextmenu', function(minder) {
});
}
$li.append($('<div>').text(label).addClass('menu-label'));
lastDivider = false;
}
......
......@@ -191,7 +191,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
}
function uuid() {
var timeLead = 1e9;
// 最多使用 1e7,否则 IE toString() 会出来指数表示法
var timeLead = 1e7;
return ((+new Date() * timeLead) + (Math.random() * --timeLead)).toString(36);
}
......
......@@ -80,8 +80,7 @@ KityMinder.registerUI('nav', function(minder) {
// 表示可视区域的矩形
var visibleRect = paper.put(new kity.Rect(100, 100).stroke('red', '1%'));
// 分别表示脑图内容区域大小和当前见区域大小
var contentView, visibleView;
var contentView = new kity.Box(), visibleView = new kity.Box();
navigate();
......@@ -109,10 +108,16 @@ KityMinder.registerUI('nav', function(minder) {
function navigate() {
function moveView(center, duration) {
var box = visibleRect.getBox();
var box = visibleView;
center.x = -center.x;
center.y = -center.y;
minder.getViewDragger().moveTo(center.offset(box.width / 2, box.height / 2), duration);
var viewMatrix = minder.getPaper().getViewPortMatrix();
box = viewMatrix.transformBox(box);
var targetPosition = center.offset(box.width / 2, box.height / 2);
minder.getViewDragger().moveTo(targetPosition, duration);
}
var dragging = false;
......@@ -137,9 +142,9 @@ KityMinder.registerUI('nav', function(minder) {
function updateContentView() {
contentView = minder.getRenderContainer().getBoundaryBox();
var view = minder.getRenderContainer().getBoundaryBox();
var view = visibleView ? contentView.merge(visibleView) : contentView;
contentView = view;
var padding = 30;
......@@ -183,8 +188,7 @@ KityMinder.registerUI('nav', function(minder) {
function updateVisibleView() {
visibleView = minder.getViewDragger().getView();
visibleRect.setBox(visibleView);
updateContentView();
visibleRect.setBox(visibleView.intersect(contentView));
}
return $previewNavigator;
......
.preview-navigator {
background: white;
width: 180px;
width: 140px;
height: 120px;
position: absolute;
left: 45px;
bottom: 30px;
box-shadow: 0 0 5px rgba(0, 0, 0, .1);
box-shadow: 0 0 8px rgba(0, 0, 0, .2);
border-radius: 0 2px 2px 0;
padding: 3px;
padding: 1px;
z-index: 9;
cursor: crosshair;
......
......@@ -174,13 +174,13 @@ input[type=url] {
color: hsl(0, 0%, 43%);
/* text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.25); */
white-space: nowrap;
vertical-align: baseline;
vertical-align: middle;
background-color: hsl(0, 0%, 99%);
border-radius: 3px;
border: 1px solid hsl(0, 0%, 80%);
text-transform: capitalize;
box-shadow: inset 0 -2px hsl(0, 0%, 92%), inset 0 -3px hsl(0, 100%, 100%), 0 1px 2px rgba(255, 255, 255, 0.3);
.mac &.ctrl,
.mac &.shift,
.mac &.alt,
......
......@@ -9,7 +9,7 @@
& > .fui-button {
left: auto;
right: 6px;
top: 11px;
top: 8px;
padding: 1px 3px;
vertical-align: middle;
position: absolute;
......
......@@ -349,7 +349,7 @@
.fui-popup-menu {
position: absolute;
z-index: 99999999999;
z-index: 9999;
min-width: 160px;
padding: 5px 0;
font-size: 12px;
......@@ -359,6 +359,7 @@
box-shadow: 0 1px 15px rgba(0, 0, 0, 0.3);
background-clip: padding-box;
font-family: Arial, "Heiti SC", "Microsoft Yahei";
overflow: hidden;
&:empty {
display: none !important;
......@@ -386,6 +387,7 @@
white-space: nowrap;
text-decoration: none;
font-size: 12px;
overflow: hidden;
transition: none;
......
......@@ -719,7 +719,7 @@ input[type=url]:focus {
color: #6e6e6e;
/* text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.25); */
white-space: nowrap;
vertical-align: baseline;
vertical-align: middle;
background-color: #fcfcfc;
border-radius: 3px;
border: 1px solid #cccccc;
......@@ -1159,7 +1159,7 @@ li {
}
.fui-popup-menu {
position: absolute;
z-index: 99999999999;
z-index: 9999;
min-width: 160px;
padding: 5px 0;
font-size: 12px;
......@@ -1169,6 +1169,7 @@ li {
box-shadow: 0 1px 15px rgba(0, 0, 0, 0.3);
background-clip: padding-box;
font-family: Arial, "Heiti SC", "Microsoft Yahei";
overflow: hidden;
}
.fui-popup-menu:empty {
display: none !important;
......@@ -1189,6 +1190,7 @@ li {
white-space: nowrap;
text-decoration: none;
font-size: 12px;
overflow: hidden;
transition: none;
}
.fui-popup-menu .fui-item .fui-label,
......@@ -2577,7 +2579,7 @@ body {
#resource-panel > .fui-panel-content > .fui-label-panel-content > .fui-button {
left: auto;
right: 6px;
top: 11px;
top: 8px;
padding: 1px 3px;
vertical-align: middle;
position: absolute;
......@@ -3229,14 +3231,14 @@ ul.resource-list li {
}
.preview-navigator {
background: white;
width: 180px;
width: 140px;
height: 120px;
position: absolute;
left: 45px;
bottom: 30px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
border-radius: 0 2px 2px 0;
padding: 3px;
padding: 1px;
z-index: 9;
cursor: crosshair;
}
......
This diff is collapsed.
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