* [ui] fix js error on open doc-quick.
This commit is contained in:
@@ -61,10 +61,15 @@ function hasPriv(priv, value)
|
||||
return value !== undefined ? setting === value : !!setting;
|
||||
}
|
||||
|
||||
function isApiLib(lib)
|
||||
function isApiLib(lib, docApp)
|
||||
{
|
||||
if(typeof lib === 'number') lib = getDocApp().getLib(lib);
|
||||
lib = lib || getDocApp().lib;
|
||||
if(!lib)
|
||||
{
|
||||
docApp = docApp || getDocApp();
|
||||
if(!docApp) return false;
|
||||
lib = docApp.lib;
|
||||
}
|
||||
return lib && lib.data.type === 'api';
|
||||
}
|
||||
|
||||
@@ -612,8 +617,7 @@ const actionsMap =
|
||||
*/
|
||||
'doc-list': function(info)
|
||||
{
|
||||
const docApp = getDocApp();
|
||||
const lib = docApp.lib;
|
||||
const docApp = this;
|
||||
const lang = getLang();
|
||||
const canModify = canModifySpace();
|
||||
|
||||
@@ -1234,7 +1238,7 @@ const customRenders =
|
||||
*/
|
||||
filters: function()
|
||||
{
|
||||
if(!isApiLib()) return;
|
||||
if(!isApiLib(null, this)) return;
|
||||
const listType = this.signals.listType.value;
|
||||
if(this.mode !== 'list' || !listType) return;
|
||||
return null;
|
||||
@@ -1410,7 +1414,7 @@ function getFilterTypes(mode)
|
||||
}
|
||||
if(mode === 'list')
|
||||
{
|
||||
const lib = getDocApp().lib;
|
||||
const lib = this.lib;
|
||||
if(lib && lib.data.type === 'api') return getLang('apifilterTypes');
|
||||
return getLang('filterTypes');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user