mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 12:35:07 +00:00
SearchBar Mobile fix.
+ disabling custom scrollbars on mobile
This commit is contained in:
parent
fbd62c1aa9
commit
37c441f888
|
@ -5,7 +5,9 @@
|
||||||
.fuse-search-bar {
|
.fuse-search-bar {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
@include media-breakpoint-down('xs') {
|
||||||
|
height: 56px;
|
||||||
|
}
|
||||||
.fuse-search-bar-expander,
|
.fuse-search-bar-expander,
|
||||||
.fuse-search-bar-collapser {
|
.fuse-search-bar-collapser {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -14,12 +16,20 @@
|
||||||
width: 64px !important;
|
width: 64px !important;
|
||||||
height: 64px !important;
|
height: 64px !important;
|
||||||
line-height: 64px !important;
|
line-height: 64px !important;
|
||||||
|
@include media-breakpoint-down('xs') {
|
||||||
|
height: 56px !important;
|
||||||
|
line-height: 56px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fuse-search-bar-loader {
|
.fuse-search-bar-loader {
|
||||||
width: 64px !important;
|
width: 64px !important;
|
||||||
height: 64px !important;
|
height: 64px !important;
|
||||||
line-height: 64px !important;
|
line-height: 64px !important;
|
||||||
|
@include media-breakpoint-down('xs') {
|
||||||
|
height: 56px !important;
|
||||||
|
line-height: 56px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fuse-search-bar-collapser {
|
.fuse-search-bar-collapser {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
import { NavigationStart, Router } from '@angular/router';
|
import { NavigationStart, Router } from '@angular/router';
|
||||||
|
import { Platform } from '@angular/cdk';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FuseConfigService
|
export class FuseConfigService
|
||||||
|
@ -12,7 +13,10 @@ export class FuseConfigService
|
||||||
/**
|
/**
|
||||||
* @param router
|
* @param router
|
||||||
*/
|
*/
|
||||||
constructor(private router: Router)
|
constructor(
|
||||||
|
private router: Router,
|
||||||
|
public platform: Platform
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Set the default settings
|
// Set the default settings
|
||||||
this.defaultSettings = {
|
this.defaultSettings = {
|
||||||
|
@ -25,9 +29,18 @@ export class FuseConfigService
|
||||||
toolbar: 'md-white-500-bg',
|
toolbar: 'md-white-500-bg',
|
||||||
navbar : 'md-fuse-dark-500-bg',
|
navbar : 'md-fuse-dark-500-bg',
|
||||||
footer : 'md-fuse-dark-800-bg'
|
footer : 'md-fuse-dark-800-bg'
|
||||||
}
|
},
|
||||||
|
customScrollbars: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable Custom Scrollbars if Browser is Mobile
|
||||||
|
*/
|
||||||
|
if ( this.platform.ANDROID || this.platform.IOS )
|
||||||
|
{
|
||||||
|
this.defaultSettings.customScrollbars = false;
|
||||||
|
}
|
||||||
|
|
||||||
this.settings = Object.assign({}, this.defaultSettings);
|
this.settings = Object.assign({}, this.defaultSettings);
|
||||||
|
|
||||||
// Reload the default settings on every navigation start
|
// Reload the default settings on every navigation start
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, ElementRef, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
|
import { Component, ElementRef, HostBinding, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { FuseConfigService } from '../core/services/config.service';
|
import { FuseConfigService } from '../core/services/config.service';
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ export class FuseMainComponent implements OnInit, OnDestroy
|
||||||
{
|
{
|
||||||
onSettingsChanged: Subscription;
|
onSettingsChanged: Subscription;
|
||||||
fuseSettings: any;
|
fuseSettings: any;
|
||||||
|
@HostBinding('class.disable-perfect-scrollbar') disableCustomScrollbars;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _renderer: Renderer2,
|
private _renderer: Renderer2,
|
||||||
|
@ -24,6 +25,7 @@ export class FuseMainComponent implements OnInit, OnDestroy
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(newSettings) => {
|
(newSettings) => {
|
||||||
this.fuseSettings = newSettings;
|
this.fuseSettings = newSettings;
|
||||||
|
this.disableCustomScrollbars = !this.fuseSettings.customScrollbars;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user