Commit a7f5106e authored by techird's avatar techird

expierence improvement

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