mirror of
https://gitee.com/openharmony/applications_launcher
synced 2024-11-27 00:51:34 +00:00
update feature/pagedesktop/src/main/ets/default/viewmodel/PageDesktopViewModel.ts.
Signed-off-by: 王志港 <wangzhigang46@huawei.com>
This commit is contained in:
parent
3cfb982463
commit
68925ae6ba
@ -779,7 +779,7 @@ export default class PageDesktopViewModel extends BaseViewModel {
|
||||
'row': row,
|
||||
'column': column
|
||||
};
|
||||
if (AppStorage.Get('isPortrait')) {
|
||||
if (AppStorage.Has('isPortrait') && AppStorage.Get('isPortrait')) {
|
||||
let cardInfoHorizontal: any[] = [];
|
||||
for (let i = 0; i < info.layoutInfo.length; i++) {
|
||||
if (info.layoutInfo[i].typeId == CommonConstants.TYPE_FOLDER) {
|
||||
@ -807,7 +807,7 @@ export default class PageDesktopViewModel extends BaseViewModel {
|
||||
AppStorage.SetOrCreate('isPortraitCard', cardInfoHorizontal);
|
||||
}
|
||||
|
||||
if (!AppStorage.Get('isPortrait')) {
|
||||
if (AppStorage.Has('isPortrait') && !AppStorage.Get('isPortrait')) {
|
||||
for (let i = 0; i < info.layoutInfo.length; i++) {
|
||||
if (info.layoutInfo[i].typeId == CommonConstants.TYPE_FOLDER) {
|
||||
let tt = info.layoutInfo[i].column
|
||||
@ -841,6 +841,15 @@ export default class PageDesktopViewModel extends BaseViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
if (!AppStorage.Has('isPortrait')) {
|
||||
newLayoutInfo.layoutDescription = {
|
||||
'pageCount': pageNum,
|
||||
'row': row,
|
||||
'column': column
|
||||
};
|
||||
newLayoutInfo.layoutInfo = [];
|
||||
}
|
||||
|
||||
return newLayoutInfo;
|
||||
}
|
||||
|
||||
@ -887,7 +896,7 @@ export default class PageDesktopViewModel extends BaseViewModel {
|
||||
isBlankPage(): boolean {
|
||||
const curPageIndex = this.mPageDesktopModel.getPageIndex();
|
||||
// 当且仅当只有一个页面时,菜单项只允许添加
|
||||
if (curPageIndex === 0 || this.getGridPageCount() <= 1) {
|
||||
if (this.getGridPageCount() <= 1) {
|
||||
return false;
|
||||
}
|
||||
if (CheckEmptyUtils.isEmpty(this.mGridAppsInfos) || CheckEmptyUtils.isEmpty(this.mGridAppsInfos[curPageIndex])
|
||||
|
Loading…
Reference in New Issue
Block a user