Commit 6a8d86c2 authored by techird's avatar techird

compalitity && navigator bug fix

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