Commit a7f5106e authored by techird's avatar techird

expierence improvement

parent 9b7017a1
......@@ -53,8 +53,8 @@ KityMinder.LANG['zh-cn'] = {
'back': '返回',
'undo': '撤销',
'redo': '重做',
'undo': '撤销 (Ctrl + Z)',
'redo': '重做 (Ctrl + Y)',
'tabs': {
'idea': '思路',
......@@ -63,9 +63,9 @@ KityMinder.LANG['zh-cn'] = {
},
'quickvisit': {
'new': '新建',
'save': '保存',
'share': '分享'
'new': '新建 (Ctrl + Alt + N)',
'save': '保存 (Ctrl + S)',
'share': '分享 (Ctrl + Alt + S)'
},
'menu': {
......
Subproject commit 27c52cd1549a85fc859e86098e87f4ec55db385d
Subproject commit 8f52e73cc57a447f268e71783d44e34ee028f763
......@@ -76,7 +76,7 @@ kity.extendClass(Minder, {
var has = 'hasOwnProperty';
this.on('keydown', function(e) {
for (var keys in map) {
if (!map[has](keys)) break;
if (!map[has](keys)) continue;
if (e.isShortcutKey(keys)) {
var fn = map[keys];
if (fn.__statusCondition && fn.__statusCondition != this.getStatus()) return;
......
......@@ -303,7 +303,7 @@ KityMinder.registerModule('TextEditModule', function() {
receiver.setContainerStyle();
},
'statuschange':function(e){
if(this.getRollbackStatus() == 'textedit'){
if(e.lastStatus == 'textedit'){
this.fire('contentchange');
}
......
......@@ -158,6 +158,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
case keymap.Backspace:
case keymap.Del:
case keymap['/']:
case keymap.F2:
if(this.selection.isHide()){
this.km.setStatus('normal');
return;
......@@ -166,7 +167,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
case keymap.Control:
case keymap.Alt:
case keymap.Cmd:
case keymap.F2:
if(this.selection.isHide() && this.km.getStatus() != 'textedit' && this.km.getStatus() !='inputready'){
this.km.setStatus('normal');
......
......@@ -47,8 +47,12 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
} else {
if (text !== undefined && !textShape) {
textShape = new kity.Text()
.setAttr('dominant-baseline', 'text-before-edge')
.setAttr('text-rendering', 'inherit');
if (kity.Browser.ie) {
textShape.setVerticalAlign('top');
} else {
textShape.setAttr('dominant-baseline', 'text-before-edge');
}
textGroup.addItem(textShape);
}
textShape.setContent(text);
......
......@@ -89,6 +89,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
if (dragger._minder.getStatus() == 'hand')
dragger._minder.rollbackStatus();
}
var paper = dragger._minder.getPaper();
paper.setStyle('cursor', dragger._minder.getStatus() == 'hand' ? '-webkit-grab' : 'default');
}
this._minder.on('normal.mousedown normal.touchstart ' +
......@@ -112,7 +114,11 @@ var ViewDragger = kity.createClass("ViewDragger", {
}
if (!isTempDrag) return;
var offset = kity.Vector.fromPoints(lastPosition, e.getPosition());
if (offset.length() > 3) this.setStatus('hand');
if (offset.length() > 10) {
this.setStatus('hand');
var paper = dragger._minder.getPaper();
paper.setStyle('cursor', '-webkit-grabbing');
}
})
.on('hand.beforemousedown hand.beforetouchstart', function(e) {
......@@ -120,6 +126,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
if (dragger.isEnabled()) {
lastPosition = e.getPosition();
e.stopPropagation();
var paper = dragger._minder.getPaper();
paper.setStyle('cursor', '-webkit-grabbing');
}
})
......@@ -219,13 +227,20 @@ KityMinder.registerModule('View', function() {
},
events: {
keyup: function(e) {
if (e.originEvent.keyCode == keymap.Spacebar && this.getSelectedNodes().length === 0) {
if (this.getStatus() == 'hand' && e.getKeyCode() == 18) {
this.execCommand('hand');
e.preventDefault();
}
},
keydown: function(e) {
var minder = this;
if (this.getStatus() != 'hand' && e.getKeyCode() == 18) {
this.execCommand('hand');
e.preventDefault();
} else if (this.getStatus() == 'hand') {
this.execCommand('hand');
}
['up', 'down', 'left', 'right'].forEach(function(name) {
if (e.isShortcutKey('ctrl+' + name)) {
minder.removeAllSelectedNodes();
......
......@@ -18,7 +18,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
.addClass('km-context-menu fui-popup-menu')
.appendTo('#content-wrapper');
$menu.delegate('li', 'click', function(e, info) {
$menu.delegate('li', 'mousedown', function(e, info) {
var item = $(e.target).closest('li').data('menu');
if (item.command) {
minder.execCommand(item.command);
......@@ -29,7 +29,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
e.preventDefault();
});
$('#content-wrapper').on('click', function(e) {
$('#content-wrapper').on('mousedown', function(e) {
$menu.hide();
});
......
......@@ -11,6 +11,7 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
function btn(name) {
return $('<a class="quick-visit-button"></a>')
.text(minder.getLang('ui.quickvisit.' + name))
.attr('title', minder.getLang('ui.quickvisit.' + name))
.addClass(name)
.appendTo('#panel');
}
......
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