mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat:将定位文档功能限定到当前会话
This commit is contained in:
@@ -12,7 +12,7 @@ function openLastSelectedNode() {
|
||||
}
|
||||
var $isSelected = false;
|
||||
if(window.localStorage){
|
||||
var $selectedNodeId = window.localStorage.getItem("MinDoc::LastLoadDocument:" + window.book.identify);
|
||||
var $selectedNodeId = window.sessionStorage.getItem("MinDoc::LastLoadDocument:" + window.book.identify);
|
||||
try{
|
||||
if($selectedNodeId){
|
||||
//遍历文档树判断是否存在节点
|
||||
@@ -51,10 +51,10 @@ function openLastSelectedNode() {
|
||||
function setLastSelectNode($node) {
|
||||
if(window.localStorage) {
|
||||
if (typeof $node === "undefined" || !$node) {
|
||||
window.localStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.identify);
|
||||
window.sessionStorage.removeItem("MinDoc::LastLoadDocument:" + window.book.identify);
|
||||
} else {
|
||||
var nodeId = $node.id ? $node.id : $node.node.id;
|
||||
window.localStorage.setItem("MinDoc::LastLoadDocument:" + window.book.identify, nodeId);
|
||||
window.sessionStorage.setItem("MinDoc::LastLoadDocument:" + window.book.identify, nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user