Commit f90cd952 authored by techird's avatar techird

bug fix

parent 3bdfe00c
...@@ -214,7 +214,9 @@ KityMinder.LANG['zh-cn'] = { ...@@ -214,7 +214,9 @@ KityMinder.LANG['zh-cn'] = {
'shortcuts': '快捷键', 'shortcuts': '快捷键',
'contact': '联系我们', 'contact': '联系我们',
'email': '邮件组', 'email': '邮件组',
'qq_group': 'QQ 群' 'qq_group': 'QQ 群',
'clipboardunsupported': '您的浏览器不支持剪贴板,请使用快捷键复制'
}, },
'popupcolor': { 'popupcolor': {
'clearColor': '清空颜色', 'clearColor': '清空颜色',
......
This diff is collapsed.
No preview for this file type
Subproject commit 2100743a23276853658906608e093d1227739084 Subproject commit 5abfcd8d5ece0bcece486dec435288ec7bcd281d
...@@ -32,6 +32,7 @@ var keymap = KityMinder.keymap = (function(origin) { ...@@ -32,6 +32,7 @@ var keymap = KityMinder.keymap = (function(origin) {
'End': 35, 'End': 35,
'Home': 36, 'Home': 36,
'Insert': 45,
'Left': 37, 'Left': 37,
'Up': 38, 'Up': 38,
...@@ -44,7 +45,6 @@ var keymap = KityMinder.keymap = (function(origin) { ...@@ -44,7 +45,6 @@ var keymap = KityMinder.keymap = (function(origin) {
39: 1, 39: 1,
40: 1 40: 1
}, },
'Insert': 45,
'Del': 46, 'Del': 46,
......
...@@ -330,14 +330,14 @@ kity.extendClass(Minder, { ...@@ -330,14 +330,14 @@ kity.extendClass(Minder, {
.start(node, duration, 'ease') .start(node, duration, 'ease')
.on('finish', function() { .on('finish', function() {
//可能性能低的时候会丢帧,手动添加一帧 //可能性能低的时候会丢帧,手动添加一帧
kity.Timeline.requestFrame(function() { setTimeout(function() {
applyMatrix(node, matrix); applyMatrix(node, matrix);
me.fire('layoutfinish', { me.fire('layoutfinish', {
node: node, node: node,
matrix: matrix matrix: matrix
}); });
consume(); consume();
}); }, 150);
}); });
} }
......
...@@ -17,7 +17,7 @@ kity.extendClass(Minder, (function() { ...@@ -17,7 +17,7 @@ kity.extendClass(Minder, (function() {
}, },
getTemplate: function() { getTemplate: function() {
return this._template || null; return this._template || 'default';
}, },
setTemplate: function(name) { setTemplate: function(name) {
...@@ -25,7 +25,7 @@ kity.extendClass(Minder, (function() { ...@@ -25,7 +25,7 @@ kity.extendClass(Minder, (function() {
}, },
getTemplateSupport: function(method) { getTemplateSupport: function(method) {
var supports = KityMinder._templates[this._template]; var supports = KityMinder._templates[this.getTemplate()];
return supports && supports[method]; return supports && supports[method];
}, },
......
...@@ -140,6 +140,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){ ...@@ -140,6 +140,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
return false; return false;
}; };
case keymap.Tab: case keymap.Tab:
case keymap.Insert:
if(this.selection.isShow()){ if(this.selection.isShow()){
this.re.clear(); this.re.clear();
this.km.setStatus('inputready'); this.km.setStatus('inputready');
...@@ -159,6 +160,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){ ...@@ -159,6 +160,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
case keymap.Del: case keymap.Del:
case keymap['/']: case keymap['/']:
case keymap.F2: case keymap.F2:
case keymap.Insert:
if(this.selection.isHide()){ if(this.selection.isHide()){
this.km.setStatus('normal'); this.km.setStatus('normal');
return; return;
...@@ -240,6 +242,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){ ...@@ -240,6 +242,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
switch (keyCode) { switch (keyCode) {
case keymap.Enter: case keymap.Enter:
case keymap.Tab: case keymap.Tab:
case keymap.Insert:
case keymap.F2: case keymap.F2:
if(browser.ipad){ if(browser.ipad){
if(this.selection.isShow()){ if(this.selection.isShow()){
......
//模拟光标 //模拟光标
Minder.Selection = kity.createClass( 'Selection', { Minder.Selection = kity.createClass( 'Selection', {
base: kity.Group, base: kity.Path,
constructor: function ( height, color, width ) { constructor: function ( height, color, width ) {
this.callBase(); this.callBase();
this.height = height || 20; this.height = height || 20;
...@@ -15,7 +15,7 @@ Minder.Selection = kity.createClass( 'Selection', { ...@@ -15,7 +15,7 @@ Minder.Selection = kity.createClass( 'Selection', {
this.setStyle('cursor','text'); this.setStyle('cursor','text');
this._show = false; this._show = false;
this.offset = []; this.offset = [];
this.setTranslate(-0.5, -1.5);
}, },
setMinderNode : function(node){ setMinderNode : function(node){
this.minderNode = node; this.minderNode = node;
...@@ -73,21 +73,31 @@ Minder.Selection = kity.createClass( 'Selection', { ...@@ -73,21 +73,31 @@ Minder.Selection = kity.createClass( 'Selection', {
} }
this._show = true; this._show = true;
}, },
updatePosition:function(offset){ updatePosition: function(offset){
var me = this; var me = this;
this.clear(); var r = Math.round;
var rect = function (x, y, w, h) {
return ['M', r(x), r(y),
'h', r(w),
'v', r(h),
'h', -r(w),
'v', -r(h),
'z'];
};
offset = offset || this.offset; offset = offset || this.offset;
if(this.collapsed){
var rect = new kity.Rect().fill(null).stroke(null).setWidth(2).setHeight(this.height); if(this.collapsed){
rect.setPosition(Math.round(offset.x) - 0.5,Math.round(offset.y) - 1.5); if (isNaN(offset.x) || isNaN(offset.y)) {
this.addShape(rect); if (console) console.warn('editor.selection.js 不正确的偏移位置');
}else{ return this;
utils.each(offset,function(i,v){ }
var rect = new kity.Rect().fill(null).stroke(null).setWidth(v.width).setHeight(me.height); this.setPathData(rect(offset.x, offset.y, this.width, this.height));
rect.setPosition(Math.round(v.x) - 0.5,Math.round(v.y) - 1.5); } else {
me.addShape(rect); this.setPathData(offset.reduce(function (prev, current) {
}); return prev.concat(rect(current.x, current.y, current.width, me.height));
}, []));
} }
this._show = true; this._show = true;
return this; return this;
......
...@@ -5,10 +5,11 @@ KityMinder.registerModule("hyperlink", function() { ...@@ -5,10 +5,11 @@ KityMinder.registerModule("hyperlink", function() {
"hyperlink": kity.createClass("hyperlink", { "hyperlink": kity.createClass("hyperlink", {
base: Command, base: Command,
execute: function(km, url) { execute: function(km, url, title) {
var nodes = km.getSelectedNodes(); var nodes = km.getSelectedNodes();
utils.each(nodes, function(i, n) { utils.each(nodes, function(i, n) {
n.setData('hyperlink', url); n.setData('hyperlink', url);
n.setData('hyperlinkTitle', title);
n.render(); n.render();
}); });
km.layout(); km.layout();
...@@ -29,7 +30,10 @@ KityMinder.registerModule("hyperlink", function() { ...@@ -29,7 +30,10 @@ KityMinder.registerModule("hyperlink", function() {
}, },
queryValue: function(km) { queryValue: function(km) {
var node = km.getSelectedNode(); var node = km.getSelectedNode();
return node.getData('hyperlink'); return {
url: node.getData('hyperlink'),
title: node.getData('hyperlinkTitle')
};
} }
}), }),
"unhyperlink": kity.createClass("hyperlink", { "unhyperlink": kity.createClass("hyperlink", {
...@@ -80,7 +84,6 @@ KityMinder.registerModule("hyperlink", function() { ...@@ -80,7 +84,6 @@ KityMinder.registerModule("hyperlink", function() {
link.setTarget('_blank'); link.setTarget('_blank');
link.setStyle('cursor', 'pointer'); link.setStyle('cursor', 'pointer');
link.on('mouseover', function() { link.on('mouseover', function() {
outline.fill('rgba(255, 255, 200, .8)'); outline.fill('rgba(255, 255, 200, .8)');
}).on('mouseout', function() { }).on('mouseout', function() {
...@@ -90,7 +93,6 @@ KityMinder.registerModule("hyperlink", function() { ...@@ -90,7 +93,6 @@ KityMinder.registerModule("hyperlink", function() {
}, },
shouldRender: function(node) { shouldRender: function(node) {
return node.getData('hyperlink'); return node.getData('hyperlink');
}, },
...@@ -98,7 +100,16 @@ KityMinder.registerModule("hyperlink", function() { ...@@ -98,7 +100,16 @@ KityMinder.registerModule("hyperlink", function() {
var href = node.getData('hyperlink'); var href = node.getData('hyperlink');
link.setHref(href); link.setHref(href);
link.setAttr('xlink:title', href); var title = node.getData('hyperlinkTitle');
if (title) {
title = [title, '(', href, ')'].join('');
} else {
title = href;
}
link.node.setAttributeNS('http://www.w3.org/1999/xlink', 'title', title);
var spaceRight = node.getStyle('space-right'); var spaceRight = node.getStyle('space-right');
link.setTranslate(box.right + spaceRight + 2, -5); link.setTranslate(box.right + spaceRight + 2, -5);
......
...@@ -32,7 +32,7 @@ KityMinder.registerModule('image', function() { ...@@ -32,7 +32,7 @@ KityMinder.registerModule('image', function() {
var ImageCommand = kity.createClass('ImageCommand', { var ImageCommand = kity.createClass('ImageCommand', {
base: Command, base: Command,
execute: function(km, url) { execute: function(km, url, title) {
var nodes = km.getSelectedNodes(); var nodes = km.getSelectedNodes();
loadImageSize(url, function(width, height) { loadImageSize(url, function(width, height) {
...@@ -43,6 +43,7 @@ KityMinder.registerModule('image', function() { ...@@ -43,6 +43,7 @@ KityMinder.registerModule('image', function() {
km.getOptions('maxImageWidth'), km.getOptions('maxImageWidth'),
km.getOptions('maxImageHeight')); km.getOptions('maxImageHeight'));
n.setData('image', url); n.setData('image', url);
n.setData('imageTitle', title);
n.setData('imageSize', size); n.setData('imageSize', size);
n.render(); n.render();
}); });
...@@ -67,7 +68,10 @@ KityMinder.registerModule('image', function() { ...@@ -67,7 +68,10 @@ KityMinder.registerModule('image', function() {
}, },
queryValue: function(km) { queryValue: function(km) {
var node = km.getSelectedNode(); var node = km.getSelectedNode();
return node.getData('image'); return {
url: node.getData('image'),
title: node.getData('imageTitle')
};
} }
}); });
...@@ -114,11 +118,16 @@ KityMinder.registerModule('image', function() { ...@@ -114,11 +118,16 @@ KityMinder.registerModule('image', function() {
update: function(image, node, box) { update: function(image, node, box) {
var url = node.getData('image'); var url = node.getData('image');
var title = node.getData('imageTitle');
var size = node.getData('imageSize'); var size = node.getData('imageSize');
var spaceTop = node.getStyle('space-top'); var spaceTop = node.getStyle('space-top');
if (!size) return; if (!size) return;
if (title) {
image.node.setAttributeNS('http://www.w3.org/1999/xlink', 'title', title);
}
var x = box.cx - size.width / 2; var x = box.cx - size.width / 2;
var y = box.y - size.height - spaceTop; var y = box.y - size.height - spaceTop;
......
...@@ -106,7 +106,7 @@ KityMinder.registerModule('NodeModule', function() { ...@@ -106,7 +106,7 @@ KityMinder.registerModule('NodeModule', function() {
'appendsiblingnode': 'normal::Enter', 'appendsiblingnode': 'normal::Enter',
'appendchildnode': 'normal::Insert|Tab', 'appendchildnode': 'normal::Insert|Tab',
'editnode': 'normal::F2', 'editnode': 'normal::F2',
'removenode': 'normal::Delete|Backspace' 'removenode': 'normal::Del|Backspace'
} }
}; };
}); });
\ No newline at end of file
...@@ -20,7 +20,7 @@ KityMinder.registerModule('Select', function() { ...@@ -20,7 +20,7 @@ KityMinder.registerModule('Select', function() {
return { return {
selectStart: function(e) { selectStart: function(e) {
// 只接受左键 // 只接受左键
if (e.originEvent.button) return; if (e.originEvent.button || e.originEvent.altKey) return;
// 清理不正确状态 // 清理不正确状态
if (startPosition) { if (startPosition) {
......
...@@ -100,7 +100,7 @@ var ViewDragger = kity.createClass("ViewDragger", { ...@@ -100,7 +100,7 @@ var ViewDragger = kity.createClass("ViewDragger", {
e.originEvent.preventDefault(); // 阻止中键拉动 e.originEvent.preventDefault(); // 阻止中键拉动
} }
// 点击未选中的根节点临时开启 // 点击未选中的根节点临时开启
if (e.getTargetNode() == this.getRoot() || e.originEvent.button == 2) { if (e.getTargetNode() == this.getRoot() || e.originEvent.button == 2 || e.originEvent.altKey) {
lastPosition = e.getPosition(); lastPosition = e.getPosition();
isTempDrag = true; isTempDrag = true;
} }
...@@ -228,20 +228,8 @@ KityMinder.registerModule('View', function() { ...@@ -228,20 +228,8 @@ KityMinder.registerModule('View', function() {
'move': MoveCommand 'move': MoveCommand
}, },
events: { events: {
keyup: function(e) {
if (this.getStatus() == 'hand' && e.getKeyCode() == 18) {
this.execCommand('hand');
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)) {
...@@ -302,7 +290,7 @@ KityMinder.registerModule('View', function() { ...@@ -302,7 +290,7 @@ KityMinder.registerModule('View', function() {
new kity.Point((a.width - b.width) / 2 | 0, (a.height - b.height) / 2 | 0)); new kity.Point((a.width - b.width) / 2 | 0, (a.height - b.height) / 2 | 0));
this._lastClientSize = a; this._lastClientSize = a;
}, },
selectionchange: function() { 'selectionchange layoutallfinish': function(e) {
var selected = this.getSelectedNode(); var selected = this.getSelectedNode();
if (!selected) return; if (!selected) return;
......
...@@ -81,7 +81,7 @@ KityMinder.registerUI('menu/share/share', function(minder) { ...@@ -81,7 +81,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
lang: minder.getLang('ui'), lang: minder.getLang('ui'),
minder: minder minder: minder
})); }));
zeroCopy(); setTimeout(zeroCopy, 10);
return $create_menu; return $create_menu;
}); });
} }
...@@ -104,6 +104,15 @@ KityMinder.registerUI('menu/share/share', function(minder) { ...@@ -104,6 +104,15 @@ KityMinder.registerUI('menu/share/share', function(minder) {
$panel.delegate('input#share-url', 'dblclick', function() { $panel.delegate('input#share-url', 'dblclick', function() {
this.select(); this.select();
}); });
$panel.delegate('#copy-share-url', 'click', function() {
if (kity.Browser.safari && kity.Browser.safari < 8) {
var input = $('#share-url');
input.focus();
input.select();
window.alert(minder.getLang('ui.clipboardunsupported'));
}
});
} }
function bindManageActions() { function bindManageActions() {
...@@ -390,24 +399,24 @@ KityMinder.registerUI('menu/share/share', function(minder) { ...@@ -390,24 +399,24 @@ KityMinder.registerUI('menu/share/share', function(minder) {
function zeroCopy() { function zeroCopy() {
/* global ZeroClipboard:true */ /* global ZeroClipboard:true */
ZeroClipboard.setDefaults({
moviePath: 'lib/ZeroClipboard.swf'
});
var $copy_url_btn = $('#copy-share-url', $create_menu); var $copy_url_btn = $('#copy-share-url', $create_menu);
if (window.ZeroClipboard) { if (window.ZeroClipboard) {
var clip = new window.ZeroClipboard($copy_url_btn, { ZeroClipboard.config({
hoverClass: 'hover', hoverClass: 'hover',
activeClass: 'active' activeClass: 'active'
}); });
clip.on('dataRequested', function(client, args) { var clip = new window.ZeroClipboard($copy_url_btn);
$copy_url_btn.text(minder.getLang('ui.copied')).attr('disabled', 'disabled'); clip.on('ready', function () {
setTimeout(function() { clip.on('aftercopy', function() {
$copy_url_btn $copy_url_btn.text(minder.getLang('ui.copied')).attr('disabled', 'disabled');
.text(minder.getLang('ui.copy')) setTimeout(function() {
.removeAttr('disabled'); $copy_url_btn
}, 3000); .text(minder.getLang('ui.copy'))
.removeAttr('disabled');
}, 3000);
});
}); });
} }
} }
......
...@@ -28,32 +28,36 @@ KityMinder.registerUI('image', function(minder) { ...@@ -28,32 +28,36 @@ KityMinder.registerUI('image', function(minder) {
var $imageDialog = new FUI.Dialog({ var $imageDialog = new FUI.Dialog({
width: 500, width: 500,
height: 400, height: 400,
prompt: true,
caption: minder.getLang('ui.image') caption: minder.getLang('ui.image')
}).appendTo(document.getElementById('content-wrapper')); }).appendTo(document.getElementById('content-wrapper'));
$imageDialog.on('ok', function() {
minder.execCommand('image', $url.val());
});
$imageDialog.on('open', function() {
$url.val(minder.queryCommandValue('image'));
$preview.attr('src', '');
error(false);
});
var $dialogBody = $($imageDialog.getBodyElement()); var $dialogBody = $($imageDialog.getBodyElement());
$dialogBody.html([ $dialogBody.html([
'<p><label>图片地址:</label><input type="url" class="image-url fui-widget fui-selection" /></p>', '<p><label>图片地址:</label><input type="url" class="image-url fui-widget fui-selectable" /></p>',
'<p><label>提示文本:</label><input type="text" class="image-title /"></p>', '<p><label>提示文本:</label><input type="text" class="image-title fui-widget fui-selectable" /></p>',
'<img class="image-preview" src="" style="max-height: 200px;" />' '<img class="image-preview" src="" style="max-height: 200px;" />'
].join('')); ].join(''));
var $url = $dialogBody.find('.image-url'); var $url = $dialogBody.find('.image-url');
var $title = $dialogBody.find('.image-title');
var $preview = $dialogBody.find('.image-preview'); var $preview = $dialogBody.find('.image-preview');
var $ok = $imageDialog.getButton(0); var $ok = $imageDialog.getButton(0);
var $errorMsg = $('<span class="validate-error"></span>'); var $errorMsg = $('<span class="validate-error"></span>');
$imageDialog.on('ok', function() {
minder.execCommand('image', $url.val(), $title.val());
});
$imageDialog.on('open', function() {
var image = minder.queryCommandValue('image');
$url.val(image.url);
$title.val(image.title);
$preview.attr('src', image.url || '');
error(false);
});
function error(value) { function error(value) {
if (value) { if (value) {
$url.addClass('validate-error'); $url.addClass('validate-error');
......
...@@ -30,6 +30,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) { ...@@ -30,6 +30,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) {
var $linkDialog = new FUI.Dialog({ var $linkDialog = new FUI.Dialog({
width: 600, width: 600,
height: 200, height: 200,
prompt: true,
caption: minder.getLang('ui.link') caption: minder.getLang('ui.link')
}).appendTo(document.getElementById('content-wrapper')); }).appendTo(document.getElementById('content-wrapper'));
...@@ -41,6 +42,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) { ...@@ -41,6 +42,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) {
].join('')); ].join(''));
var $href = $dialogBody.find('.link-href'); var $href = $dialogBody.find('.link-href');
var $title = $dialogBody.find('.link-title');
var $ok = $linkDialog.getButton(0); var $ok = $linkDialog.getButton(0);
var $errorMsg = $('<span class="validate-error"></span>'); var $errorMsg = $('<span class="validate-error"></span>');
...@@ -73,11 +75,13 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) { ...@@ -73,11 +75,13 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) {
}); });
$linkDialog.on('ok', function() { $linkDialog.on('ok', function() {
minder.execCommand('hyperlink', $href.val()); minder.execCommand('hyperlink', $href.val(), $title.val() || '');
}); });
$linkDialog.on('open', function() { $linkDialog.on('open', function() {
$href.val(minder.queryCommandValue('hyperlink')); var value = minder.queryCommandValue('hyperlink');
$href.val(value.url);
$title.val(value.title);
error(false); error(false);
}); });
......
...@@ -32,7 +32,7 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) { ...@@ -32,7 +32,7 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
var resource = $addInput.getValue(); var resource = $addInput.getValue();
var origin = minder.queryCommandValue('resource'); var origin = minder.queryCommandValue('resource');
if (resource) { if (resource) {
origin.push(resource); if (!~origin.indexOf(resource)) origin.unshift(resource);
minder.execCommand('resource', origin); minder.execCommand('resource', origin);
} }
$addInput.setValue(null); $addInput.setValue(null);
...@@ -68,6 +68,21 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) { ...@@ -68,6 +68,21 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
var resource = minder.queryCommandValue('resource'); var resource = minder.queryCommandValue('resource');
var used = minder.getUsedResource(); var used = minder.getUsedResource();
switch (minder.queryCommandState('resource')) {
case 0:
$addInput.enable();
$addButton.enable();
$resourceDrop.enable();
$ul.find('input[type=checkbox]').removeAttr('disabled');
break;
case -1:
$addInput.disable();
$addButton.disable();
$resourceDrop.disable();
$ul.find('input[type=checkbox]').attr('disabled', true);
break;
}
if (!changed(resource, used)) return; if (!changed(resource, used)) return;
var delta = used.length - $ul.children().length; var delta = used.length - $ul.children().length;
...@@ -91,20 +106,6 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) { ...@@ -91,20 +106,6 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
backgroundColor: ~resource.indexOf(name) ? color : color.dec('a', 0.85).toRGBA() backgroundColor: ~resource.indexOf(name) ? color : color.dec('a', 0.85).toRGBA()
}); });
}); });
switch (minder.queryCommandState('resource')) {
case 0:
$addInput.enable();
$addButton.enable();
$resourceDrop.enable();
$ul.find('input[type=checkbox]').removeProp('disabled');
break;
case -1:
$addInput.disable();
$addButton.disable();
$resourceDrop.disable();
$ul.find('input[type=checkbox]').prop('disabled', 'disabled');
}
} }
minder.on('interactchange', update); minder.on('interactchange', update);
......
...@@ -28,6 +28,7 @@ KityMinder.registerUI('ribbon/tabs', function(minder) { ...@@ -28,6 +28,7 @@ KityMinder.registerUI('ribbon/tabs', function(minder) {
// 隐藏效果 // 隐藏效果
var lastIndex = 0; var lastIndex = 0;
var muteRemember = false;
$tab.on('tabsselect', function(e, info) { $tab.on('tabsselect', function(e, info) {
if (info.index == lastIndex) { if (info.index == lastIndex) {
$container.toggleClass('collapsed'); $container.toggleClass('collapsed');
...@@ -36,8 +37,10 @@ KityMinder.registerUI('ribbon/tabs', function(minder) { ...@@ -36,8 +37,10 @@ KityMinder.registerUI('ribbon/tabs', function(minder) {
$container.removeClass('collapsed'); $container.removeClass('collapsed');
$header.removeClass('collapsed'); $header.removeClass('collapsed');
} }
memory.set('ribbon-tab-collapsed', $container.hasClass('collapsed')); if (!muteRemember) {
memory.set('ribbon-tab-index', info.index); memory.set('ribbon-tab-collapsed', $container.hasClass('collapsed'));
memory.set('ribbon-tab-index', info.index);
}
lastIndex = info.index; lastIndex = info.index;
}); });
...@@ -48,7 +51,9 @@ KityMinder.registerUI('ribbon/tabs', function(minder) { ...@@ -48,7 +51,9 @@ KityMinder.registerUI('ribbon/tabs', function(minder) {
var rememberIndex = memory.get('ribbon-tab-index'); var rememberIndex = memory.get('ribbon-tab-index');
var rememberCollapse = memory.get('ribbon-tab-collapsed'); var rememberCollapse = memory.get('ribbon-tab-collapsed');
muteRemember = true;
$tab.select(rememberIndex || 0); $tab.select(rememberIndex || 0);
muteRemember = false;
if (rememberCollapse) { if (rememberCollapse) {
$container.addClass('collapsed'); $container.addClass('collapsed');
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
vertical-align: middle; vertical-align: middle;
} }
span.validate-error {
margin-left: 5px;
}
.button, button { .button, button {
display: inline-block; display: inline-block;
height: 30px; height: 30px;
......
...@@ -410,6 +410,10 @@ ...@@ -410,6 +410,10 @@
color: white; color: white;
} }
} }
.menu-label {
display: inline-block;
}
.shortcut { .shortcut {
float: right; float: right;
......
...@@ -562,6 +562,9 @@ ...@@ -562,6 +562,9 @@
border-color: red !important; border-color: red !important;
vertical-align: middle; vertical-align: middle;
} }
span.validate-error {
margin-left: 5px;
}
.button, .button,
button { button {
display: inline-block; display: inline-block;
...@@ -1242,6 +1245,9 @@ li { ...@@ -1242,6 +1245,9 @@ li {
.fui-popup-menu .fui-item :focus .fui-label { .fui-popup-menu .fui-item :focus .fui-label {
color: white; color: white;
} }
.fui-popup-menu .fui-item .menu-label {
display: inline-block;
}
.fui-popup-menu .fui-item .shortcut { .fui-popup-menu .fui-item .shortcut {
float: right; float: right;
margin-left: 20px; margin-left: 20px;
......
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