* [misc] add btn to go to old doc page.
This commit is contained in:
@@ -239,3 +239,15 @@ window.setDocAppOptions = function(_, options)
|
||||
};
|
||||
return newOptions;
|
||||
};
|
||||
|
||||
window.goToOldDocPage = function()
|
||||
{
|
||||
const docApp = getDocApp();
|
||||
if(!docApp) return;
|
||||
|
||||
zui.store.set('docAppEnabled', false);
|
||||
const spaceType = docApp.signals.spaceType.value
|
||||
const map = {mine: 'myspace', custom: 'teamspace', product: 'productspace', project: 'projectspace'};
|
||||
const method = map[spaceType];
|
||||
$.apps.openUrl($.createLink('doc', method));
|
||||
};
|
||||
|
||||
@@ -38,6 +38,15 @@ zui::docApp
|
||||
set::currentUser($this->app->user->account),
|
||||
set('$options', jsRaw('window.setDocAppOptions')),
|
||||
);
|
||||
|
||||
btn
|
||||
(
|
||||
setClass('absolute right-1.5 bottom-1.5 size-sm z-10'),
|
||||
set::type('special-pale'),
|
||||
set::icon('back'),
|
||||
on::click()->call('goToOldDocPage'),
|
||||
'切换回旧版界面',
|
||||
css('#mainContent {position: relative}')
|
||||
);
|
||||
|
||||
/* Modify navbar. 修改二级导航。 */
|
||||
|
||||
Reference in New Issue
Block a user