Commit e9d87fe6 authored by zhangbo's avatar zhangbo

add rediret && bug fix

parent 1e41f4c8
...@@ -229,8 +229,7 @@ ...@@ -229,8 +229,7 @@
font-size: 16px; font-size: 16px;
padding-left: 15px; padding-left: 15px;
border-bottom: none; border-bottom: none;
position: absolute; .dock;
width: 100%;
} }
.priority { .priority {
height: 20px; height: 20px;
...@@ -310,16 +309,18 @@ ...@@ -310,16 +309,18 @@
padding: 3px 5px; padding: 3px 5px;
border-radius: 2px; border-radius: 2px;
font-size: 12px; font-size: 12px;
line-height: 16px;
color: rgb(77, 65, 0); color: rgb(77, 65, 0);
vertical-align: middle; vertical-align: middle;
margin-left: 8px; margin: 14px 8px;
float: right;
} }
.hyperlink { .hyperlink {
display: inline-block; display: block;
/* float: left; */ float: right;
width: 30px; width: 30px;
height: 20px; height: 20px;
margin-left: 15px; margin: 15px;
padding: 0; padding: 0;
background: url(../images/icons.png) no-repeat 0 -80px; background: url(../images/icons.png) no-repeat 0 -80px;
background-size: 20px; background-size: 20px;
...@@ -355,11 +356,11 @@ ...@@ -355,11 +356,11 @@
.dock; .dock;
} }
.text { .text {
width:12em; display: block;
white-space:nowrap; white-space: nowrap;
text-overflow:ellipsis; text-overflow: ellipsis;
-o-text-overflow:ellipsis; -o-text-overflow: ellipsis;
overflow:hidden; overflow: hidden;
vertical-align: middle; vertical-align: middle;
} }
} }
\ No newline at end of file
...@@ -14,16 +14,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) { ...@@ -14,16 +14,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
$('<div class="back"></div>').appendTo('#m-logo'); $('<div class="back"></div>').appendTo('#m-logo');
var treeData; var treeData;
var $curView=$('<div>'); var $curView=$('<div id="curView">');
var $preView=$('<div>'); var $preView=$('<div id="preView">');
minder.on('uiready', function() { minder.on('uiready', function() {
var shareView = minder.getUI('menu/share/m-share'); var shareView = minder.getUI('menu/share/m-share');
shareView.ready.then(function(){ shareView.ready.then(function(){
treeData = addParentPointer(minder); treeData = addParentPointer(minder);
$curView = renderNodeData(treeData, minder, $curView); renderNodeData(treeData, minder, $curView);
$preView = renderNodeData(treeData, minder, $preView); renderNodeData(treeData, minder, $preView);
$('#km-list-view').append($curView); $('#km-list-view').append($curView);
$('#km-list-view').append($preView); $('#km-list-view').append($preView);
$preView.css('x', '100%'); $preView.css('x', '100%');
...@@ -48,11 +48,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) { ...@@ -48,11 +48,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
$('#km-list-view').delegate('li', 'click', function(){ $('#km-list-view').delegate('li', 'click', function(){
var preViewData = $(this).data(); var preViewData = $(this).data();
renderNodeData(preViewData, minder, $preView);
if (preViewData.children) { if (preViewData.children) {
renderNodeData(preViewData, minder, $preView);
// $curView.css('x');
// console.log($preView.css('x'));
$preView.css('x', parseInt($curView.css('x')) + 100 + '%');
// console.log($preView.css('x'));
// $('#km-list-view').css('x', '0');
$('#km-list-view').transition({ $('#km-list-view').transition({
x: '-100%', x: parseInt($('#km-list-view').css('x')) - 100 + '%',
duration: 200, duration: 200,
easing: 'ease', easing: 'ease',
complete: function(){ complete: function(){
...@@ -70,11 +75,14 @@ KityMinder.registerUI('topbar/switch-view', function(minder) { ...@@ -70,11 +75,14 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
}); });
$('.back').on('click', function(){ $('.back').on('click', function(){
var parentViewData = $('.cur-root').data(); var parentViewData = $('.cur-root', $curView).data();
$preView.css('x', '0'); renderNodeData(parentViewData, minder, $preView);
$preView.css('x', parseInt($curView.css('x')) - 100 + '%');
// $curView.css('x');
// $('#km-list-view').css('x', '-100%');
$('#km-list-view').transition({ $('#km-list-view').transition({
x: '0', x: parseInt($('#km-list-view').css('x')) + 100 + '%',
duration: 200, duration: 200,
easing: 'ease', easing: 'ease',
complete: function(){ complete: function(){
...@@ -135,6 +143,7 @@ function renderNodeData(node, minder, $target){ ...@@ -135,6 +143,7 @@ function renderNodeData(node, minder, $target){
}); });
} }
// debugger;
return $target.html($curRoot.add($curList)); return $target.html($curRoot.add($curList));
} }
...@@ -167,7 +176,7 @@ function createListNode(node, minder){ ...@@ -167,7 +176,7 @@ function createListNode(node, minder){
// 处理子节点 // 处理子节点
if (node.children){ if (node.children){
$list.addClass('clickable'); $list.addClass('clickable');
$list.append('<span class="next-level"></span>'); $list.children().first().before('<span class="next-level"></span>');
$list.data(node); $list.data(node);
} }
...@@ -193,8 +202,6 @@ function getNodeHtml (node, minder){ ...@@ -193,8 +202,6 @@ function getNodeHtml (node, minder){
html += '<div class="progress progress-' + data.progress + '"></div>' html += '<div class="progress progress-' + data.progress + '"></div>'
} }
// 处理文字
html += '<span class="text">' + (data.text || '') + '</span>';
// 处理超链接 // 处理超链接
if (data.hyperlink) { if (data.hyperlink) {
html +='<a class="hyperlink" href="'+ data.hyperlink +'" target="_blank"></a>'; html +='<a class="hyperlink" href="'+ data.hyperlink +'" target="_blank"></a>';
...@@ -206,6 +213,9 @@ function getNodeHtml (node, minder){ ...@@ -206,6 +213,9 @@ function getNodeHtml (node, minder){
}); });
} }
// 处理文字
if (data.text) {
html += '<span class="text">' + (data.text || '') + '</span>';
}
return html; return html;
} }
...@@ -9,6 +9,25 @@ ...@@ -9,6 +9,25 @@
<title>百度脑图 - 便捷的思维导图工具</title> <title>百度脑图 - 便捷的思维导图工具</title>
<!--Judge whether it is mobile visited -->
<script>
function browserRedirect() {
var sUserAgent= navigator.userAgent.toLowerCase();
var bIsIpad= sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp= sUserAgent.match(/midp/i) == "midp";
var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid= sUserAgent.match(/android/i) == "android";
var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
window.location.href= window.location.href.replace('viewshare.html', 'm-share.html');
}
}
browserRedirect();
</script>
<script src="import.share.js" charset="utf-8"></script> <script src="import.share.js" charset="utf-8"></script>
<script src="kityminder.config.js" charset="utf-8"></script> <script src="kityminder.config.js" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script> <script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script>
......
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