@ -11,7 +11,7 @@ import {properties} from "../../../../environments/environment";
import { StringUtils } from "../../utils/string-utils.class" ;
import { Title } from "@angular/platform-browser" ;
import { AlertModal } from '../../utils/modal/alert' ;
import { Menu ItemExtended} from '../../sharedComponents/menu' ;
import { Menu Alignment, Menu ItemExtended} from '../../sharedComponents/menu' ;
import { SearchInputComponent } from '../../sharedComponents/search-input/search-input.component' ;
import { Option } from '../../sharedComponents/input/input.component' ;
import { CommunityInfo } from '../../connect/community/communityInfo' ;
@ -24,7 +24,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
import { NotificationHandler } from '../../utils/notification-handler' ;
// import {Page} from "../../utils/entities/adminTool/page";
// declare var UIkit;
declare var UIkit ;
@Component ( {
selector : 'menuSelector' ,
@ -62,7 +62,8 @@ export class MenuComponent implements OnInit {
public showNormalMenu : boolean = false ;
public showFeaturedMenu : boolean = false ;
public featuredAlignment : string = MenuAlignment . CENTER . valueOf ( ) ;
public communities : Portal [ ] = [ ] ;
public portal : string ;
public name : string ;
@ -155,6 +156,7 @@ export class MenuComponent implements OnInit {
this . normalMenuItems = data . menuItems ;
this . showFeaturedMenu = data . isFeaturedMenuEnabled ;
this . showNormalMenu = data . isMenuEnabled ;
this . featuredAlignment = data . featuredAlignment . valueOf ( ) ;
this . getPages ( ) ;
this . getParentOptions ( ) ;
this . showLoading = false ;
@ -421,12 +423,26 @@ export class MenuComponent implements OnInit {
}
this . _clearCacheService . clearCache ( "Menu toggled" ) ;
this . _clearCacheService . purgeBrowserCache ( "Menu toggled" , this . portal ) ;
} , error = > {
NotificationHandler . rise ( "Menu has been <b>successfully toggled to be " + ( status ? "visible" : "hidden" ) + "</b>" ) ;
} , error = > {
this . handleError ( "System error toggling menu" , error ) ;
} )
) ;
}
public alignMenu ( alignment : string ) {
this . subscriptions . push (
this . _helpContentService . alignMenu ( MenuAlignment [ alignment ] , this . portal ) . subscribe ( ( ) = > {
this . featuredAlignment = alignment ;
this . _clearCacheService . clearCache ( "Menu aligned" ) ;
this . _clearCacheService . purgeBrowserCache ( "Menu aligned" , this . portal ) ;
NotificationHandler . rise ( "Menu has been <b>successfully " + alignment . toLowerCase ( ) + " aligned</b>" ) ;
} , error = > {
this . handleError ( "System error aligning menu to the " + alignment . toLowerCase ( ) , error ) ;
} )
) ;
}
// public newPageWindow() {
// this.newPageWindowOpen = !this.newPageWindowOpen;
// this.pageForm = this._fb.group({
@ -465,11 +481,7 @@ export class MenuComponent implements OnInit {
// this._helpContentService.savePage(<Page>this.pageForm.value, this.properties.adminToolsAPIURL).subscribe(
// page => {
// this.allPages.push({value: page.route, label: page.name});
// UIkit.notification('Page <b>' + page.name + '</b> has been <b>successfully created</b>', {
// status: 'success',
// timeout: 6000,
// pos: 'bottom-right'
// });
// NotificationHandler.rise('Page <b>' + page.name + '</b> has been <b>successfully created</b>');
// this.newPageWindowOpen = !this.newPageWindowOpen;
// this.menuItemForm.get('route').setValue(page.route);
// this.menuItemForm.get('route').markAsDirty();