feat:将定位文档功能限定到当前会话

This commit is contained in:
lifei6671
2018-08-17 17:39:03 +08:00
parent bb7d1c1503
commit fede48cf51
2 changed files with 8 additions and 6 deletions

View File

@@ -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);
}
}
}