Skip to content

Commit

Permalink
feat(bs4): updated to alfa 5 Class name changes (#1201)
Browse files Browse the repository at this point in the history
Updated modal windows and dropdowns to work with latest bootstrap code
on v4-dev branch
  • Loading branch information
Gillardo authored and valorkin committed Nov 4, 2016
1 parent 83452e1 commit 49197f0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/dropdown/dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { dropdownService, NONINPUT } from './dropdown.service';
})
export class DropdownDirective implements OnInit, OnDestroy {
@HostBinding('class.open')
@HostBinding('class.active')
@Input()
public get isOpen():boolean {
return this._isOpen;
Expand Down
1 change: 1 addition & 0 deletions components/modal/modal-backdrop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class ModalBackdropComponent {
public set isShown(value:boolean) {
this._isShown = value;
this.renderer.setElementClass(this.element.nativeElement, `${ClassName.IN}`, value);
this.renderer.setElementClass(this.element.nativeElement, `${ClassName.ACTIVE}`, value);
}

public element:ElementRef;
Expand Down
3 changes: 2 additions & 1 deletion components/modal/modal-options.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const ClassName:any = {
BACKDROP: 'modal-backdrop',
OPEN: 'modal-open',
FADE: 'fade',
IN: 'in'
IN: 'in', // bs3
ACTIVE: 'active' // bs4
};

export const Selector:any = {
Expand Down
2 changes: 2 additions & 0 deletions components/modal/modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy {

this._isShown = false;
this.renderer.setElementClass(this.element.nativeElement, ClassName.IN, false);
this.renderer.setElementClass(this.element.nativeElement, ClassName.ACTIVE, false);
// this._addClassIn = false;

if (this.isAnimated) {
Expand Down Expand Up @@ -200,6 +201,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy {

// this._addClassIn = true;
this.renderer.setElementClass(this.element.nativeElement, ClassName.IN, true);
this.renderer.setElementClass(this.element.nativeElement, ClassName.ACTIVE, true);

const transitionComplete = () => {
if (this._config.focus) {
Expand Down
3 changes: 2 additions & 1 deletion demo/index-bs4.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,700" rel="stylesheet" type="text/css">

<!--link to bootstrap.css v4.0.0-alpha-->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet">
<!--<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">-->
<link rel="stylesheet" href="assets/css/glyphicons.css">
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/prettify-angulario.css">
Expand Down

0 comments on commit 49197f0

Please sign in to comment.