diff --git a/package.json b/package.json index 21757526..9d35ba2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ntk-cms-web", - "version": "15.2.0825.3", + "version": "15.2.0825.4", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src/app/_metronic/kt/_utils/DomHelpers.ts b/src/app/_metronic/kt/_utils/DomHelpers.ts index df09f376..62339731 100644 --- a/src/app/_metronic/kt/_utils/DomHelpers.ts +++ b/src/app/_metronic/kt/_utils/DomHelpers.ts @@ -1,9 +1,10 @@ +import { environment } from 'src/environments/environment' import { ElementAnimateUtil } from './ElementAnimateUtil' -import { OffsetModel } from './models/OffsetModel' -import { ViewPortModel } from './models/ViewPortModel' import { DataUtil } from './_DataUtil' import { ElementStyleUtil } from './_ElementStyleUtil' import { getObjectPropertyValueByKey, toJSON } from './_TypesHelpers' +import { OffsetModel } from './models/OffsetModel' +import { ViewPortModel } from './models/ViewPortModel' function getCSS(el: HTMLElement, styleProp: string) { const defaultView = (el.ownerDocument || document).defaultView @@ -242,9 +243,9 @@ function getElementChild(element: HTMLElement, selector: string): HTMLElement | } function isMobileDevice(): boolean { - if (getViewPort().width < 1000) + if (window.innerWidth < environment.cmsViewConfig.mobileWindowInnerWidth) return true; - let test = getViewPort().width < +getBreakpoint('lg') ? true : false + let test = window.innerWidth < +getBreakpoint('lg') ? true : false if (test === false) { // For use within normal web clients @@ -397,7 +398,7 @@ function getAttributeValueByBreakpoint(incomingAttr: string): string | JSON { return incomingAttr } - const width = getViewPort().width + const width = window.innerWidth let resultKey let resultBreakpoint = -1 let breakpoint diff --git a/src/app/_metronic/kt/components/SearchComponent.ts b/src/app/_metronic/kt/components/SearchComponent.ts index 88a6609d..50253502 100644 --- a/src/app/_metronic/kt/components/SearchComponent.ts +++ b/src/app/_metronic/kt/components/SearchComponent.ts @@ -129,7 +129,7 @@ class SearchComponent { // Check if responsive form mode is enabled private getResponsiveFormMode = () => { const responsive = this.getOption('responsive') as string - const width = getViewPort().width + const width = window.innerWidth if (!responsive) { return null diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 199c06ea..9ad79b99 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,7 +16,6 @@ import { getAnalytics } from "firebase/analytics"; import { initializeApp } from "firebase/app"; import { CoreAuthService, CoreSiteService, CoreSiteSupportModel, DeviceTypeEnum, ErrorExceptionResult, OperatingSystemTypeEnum, TokenDeviceClientInfoDtoModel, TokenDeviceSetNotificationIdDtoModel } from 'ntk-cms-api'; import { environment } from 'src/environments/environment'; -import { getViewPort } from './_metronic/kt/_utils/DomHelpers'; import { ThemeModeService } from './_metronic/partials/layout/theme-mode-switcher/theme-mode.service'; import { PublicHelper } from './core/helpers/publicHelper'; import { TokenHelper } from './core/helpers/tokenHelper'; @@ -101,7 +100,7 @@ export class AppComponent implements OnInit { }); } - console.log('windows innerWidth size:', getViewPort()); + console.log('windows innerWidth size:', window.innerWidth); } cmsApiStoreSubscribe: Subscription; dataSupportModelResult: ErrorExceptionResult; diff --git a/src/app/cms-modules/auth/auth.component.ts b/src/app/cms-modules/auth/auth.component.ts index 35659e7a..1faf41e8 100644 --- a/src/app/cms-modules/auth/auth.component.ts +++ b/src/app/cms-modules/auth/auth.component.ts @@ -6,6 +6,7 @@ import { PublicHelper } from 'src/app/core/helpers/publicHelper'; import { ProgressSpinnerModel } from 'src/app/core/models/progressSpinnerModel'; import { CmsToastrService } from 'src/app/core/services/cmsToastr.service'; import { getViewPort } from 'src/app/_metronic/kt/_utils/DomHelpers'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-auth', templateUrl: './auth.component.html', @@ -26,7 +27,7 @@ export class AuthComponent implements OnInit { showSplashModel = true; ngOnInit(): void { - if (getViewPort().width < 860) { + if (window.innerWidth < environment.cmsViewConfig.mobileWindowInnerWidth) { setTimeout(() => { this.showSplashModel = false; this.cdr.markForCheck(); diff --git a/src/app/core/helpers/publicHelper.ts b/src/app/core/helpers/publicHelper.ts index cb46839d..9a252295 100644 --- a/src/app/core/helpers/publicHelper.ts +++ b/src/app/core/helpers/publicHelper.ts @@ -48,10 +48,8 @@ export class PublicHelper { } get isMobile() { - if (window.innerWidth < 1000) + if (window.innerWidth < environment.cmsViewConfig.mobileWindowInnerWidth) return true; - // if (isMobileDevice()) - // return true; return false; }; @@ -521,7 +519,7 @@ export class PublicHelper { cloumnAdminAccessDispaly = []; } var cloumn: string[] = []; - if (window.innerWidth < 1000 && cloumnMobileDispalySource && cloumnMobileDispalySource.length > 0) { + if (window.innerWidth < environment.cmsViewConfig.mobileWindowInnerWidth && cloumnMobileDispalySource && cloumnMobileDispalySource.length > 0) { cloumn = JSON.parse(JSON.stringify(cloumnMobileDispalySource)); } else if (cloumnDesktopSource && cloumnDesktopSource.length > 0) { cloumn = JSON.parse(JSON.stringify(cloumnDesktopSource)); diff --git a/src/app/core/helpers/tokenHelper.ts b/src/app/core/helpers/tokenHelper.ts index 56006677..dcb3102f 100644 --- a/src/app/core/helpers/tokenHelper.ts +++ b/src/app/core/helpers/tokenHelper.ts @@ -10,6 +10,7 @@ import { import { Observable, Subscription, firstValueFrom } from 'rxjs'; import { TranslationService } from '../i18n/translation.service'; import { CmsStoreService } from '../reducers/cmsStore.service'; +import { environment } from 'src/environments/environment'; @Injectable({ providedIn: 'root', @@ -26,10 +27,8 @@ export class TokenHelper implements OnDestroy { } get isMobile() { - if (window.innerWidth < 1000) + if (window.innerWidth < environment.cmsViewConfig.mobileWindowInnerWidth) return true; - // if (isMobileDevice()) - // return true; return false; }; tokenInfo: TokenInfoModel = new TokenInfoModel(); diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 55a32184..f7da08bb 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -32,6 +32,7 @@ export const environment = { PackageName: '', }, cmsViewConfig: { + mobileWindowInnerWidth:1000, tableRowMouseEnter: false, enterAnimationDuration: '1500ms', exitAnimationDuration: '1000ms' diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 40c2ed45..e4a35631 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -36,6 +36,7 @@ export const environment = { PackageName: '', }, cmsViewConfig: { + mobileWindowInnerWidth:1000, tableRowMouseEnter: true, enterAnimationDuration: '1500ms', exitAnimationDuration: '1000ms'