Skip to content

Commit

Permalink
fix(ie9,10): usage of [hidden] replaced with *ngIf (fixes #238)
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Mar 30, 2016
1 parent e5c7dc1 commit 260e963
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ export enum Direction {UNKNOWN, NEXT, PREV}

const NAVIGATION:any = {
[Ng2BootstrapTheme.BS4]: `
<a class="left carousel-control" (click)="prev()" [hidden]="!slides.length">
<a class="left carousel-control" (click)="prev()" *ngIf="slides.length">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" (click)="next()" [hidden]="!slides.length">
<a class="right carousel-control" (click)="next()" *ngIf="slides.length">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
`,
[Ng2BootstrapTheme.BS3]: `
<a class="left carousel-control" (click)="prev()" [hidden]="!slides.length">
<a class="left carousel-control" (click)="prev()" *ngIf="slides.length">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" (click)="next()" [hidden]="!slides.length">
<a class="right carousel-control" (click)="next()" *ngIf="slides.length">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
`
Expand All @@ -36,7 +36,7 @@ const NAVIGATION:any = {
directives: [NgFor],
template: `
<div (mouseenter)="pause()" (mouseleave)="play()" class="carousel slide">
<ol class="carousel-indicators" [hidden]="slides.length <= 1">
<ol class="carousel-indicators" *ngIf="slides.length > 1">
<li *ngFor="#slidez of slides" [class.active]="slidez.active === true" (click)="select(slidez)"></li>
</ol>
<div class="carousel-inner"><ng-content></ng-content></div>
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/datepicker-inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const KEYS = {
selector: 'datepicker-inner',
events: ['update'],
template: `
<div [hidden]="!datepickerMode" class="well well-sm bg-faded p-a card" role="application" ><!--&lt;!&ndash;ng-keydown="keydown($event)"&ndash;&gt;-->
<div *ngIf="datepickerMode" class="well well-sm bg-faded p-a card" role="application" ><!--&lt;!&ndash;ng-keydown="keydown($event)"&ndash;&gt;-->
<ng-content></ng-content>
</div>
`,
Expand Down
8 changes: 4 additions & 4 deletions components/datepicker/daypicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const TEMPLATE_OPTIONS:any = {
<th *ngFor="#labelz of labels" class="text-xs-center"><small aria-label="labelz.full"><b>{{labelz.abbr}}</b></small></th>
`,
WEEK_ROW: `
<td [hidden]="!datePicker.showWeeks" class="text-xs-center h6"><em>{{ weekNumbers[index] }}</em></td>
<td *ngIf="datePicker.showWeeks" class="text-xs-center h6"><em>{{ weekNumbers[index] }}</em></td>
<td *ngFor="#dtz of rowz" class="text-xs-center" role="gridcell" [id]="dtz.uid">
<button type="button" style="min-width:100%;" class="btn btn-sm {{dtz.customClass}}"
*ngIf="!(datePicker.onlyCurrentMonth && dtz.secondary)"
Expand All @@ -30,7 +30,7 @@ const TEMPLATE_OPTIONS:any = {
<th *ngFor="#labelz of labels" class="text-center"><small aria-label="labelz.full"><b>{{labelz.abbr}}</b></small></th>
`,
WEEK_ROW: `
<td [hidden]="!datePicker.showWeeks" class="text-center h6"><em>{{ weekNumbers[index] }}</em></td>
<td *ngIf="datePicker.showWeeks" class="text-center h6"><em>{{ weekNumbers[index] }}</em></td>
<td *ngFor="#dtz of rowz" class="text-center" role="gridcell" [id]="dtz.uid">
<button type="button" style="min-width:100%;" class="btn btn-default btn-sm {{dtz.customClass}}"
*ngIf="!(datePicker.onlyCurrentMonth && dtz.secondary)"
Expand All @@ -55,7 +55,7 @@ const CURRENT_THEME_TEMPLATE:any = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme ||
@Component({
selector: 'daypicker, [daypicker]',
template: `
<table [hidden]="datePicker.datepickerMode!=='day'" role="grid" aria-labelledby="uniqueId+'-title'" aria-activedescendant="activeDateId">
<table *ngIf="datePicker.datepickerMode==='day'" role="grid" aria-labelledby="uniqueId+'-title'" aria-activedescendant="activeDateId">
<thead>
<tr>
<th>
Expand All @@ -79,7 +79,7 @@ const CURRENT_THEME_TEMPLATE:any = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme ||
</th>
</tr>
<tr>
<th [hidden]="!datePicker.showWeeks"></th>
<th *ngIf="datePicker.showWeeks"></th>
${CURRENT_THEME_TEMPLATE.DAY_TITLE}
</tr>
</thead>
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/monthpicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const CURRENT_THEME_TEMPLATE:any = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme] ||
@Component({
selector: 'monthpicker, [monthpicker]',
template: `
<table [hidden]="datePicker.datepickerMode!=='month'" role="grid">
<table *ngIf="datePicker.datepickerMode==='month'" role="grid">
<thead>
<tr>
<th>
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/yearpicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CURRENT_THEME_TEMPLATE:any = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme] ||
@Component({
selector: 'yearpicker, [yearpicker]',
template: `
<table [hidden]="datePicker.datepickerMode!=='year'" role="grid">
<table *ngIf="datePicker.datepickerMode==='year'" role="grid">
<thead>
<tr>
<th>
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/tabset.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {Tab} from './tab.directive';
[class.active]="tabz.active" [class.disabled]="tabz.disabled"
(click)="tabz.active = true">
<span [ngTransclude]="tabz.headingRef">{{tabz.heading}}</span>
<span [hidden]="!tabz.removable">
<span *ngIf="tabz.removable">
<span (click)="$event.preventDefault(); removeTab(tabz);" class="glyphicon glyphicon-remove-circle"></span>
</span>
</a>
Expand Down
6 changes: 3 additions & 3 deletions components/timepicker/timepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function addMinutes(date:any, minutes:number) {
<td><a (click)="incrementHours()" [ngClass]="{disabled: noIncrementHours()}" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
<td>&nbsp;</td>
<td><a (click)="incrementMinutes()" [ngClass]="{disabled: noIncrementMinutes()}" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
<td [ngClass]="{hidden: !showMeridian}" [hidden]="!showMeridian"></td>
<td [ngClass]="{hidden: !showMeridian}" *ngIf="showMeridian"></td>
</tr>
<tr>
<td class="form-group" [ngClass]="{'has-error': invalidHours}">
Expand All @@ -69,13 +69,13 @@ function addMinutes(date:any, minutes:number) {
<td class="form-group" [ngClass]="{'has-error': invalidMinutes}">
<input style="width:50px;" type="text" [(ngModel)]="minutes" (change)="updateMinutes()" class="form-control text-center" [readonly]="readonlyInput" (blur)="minutesOnBlur($event)" maxlength="2">
</td>
<td [ngClass]="{hidden: !showMeridian}" [hidden]="!showMeridian"><button type="button" [ngClass]="{disabled: noToggleMeridian()}" class="btn btn-default text-center" (click)="toggleMeridian()">{{meridian}}</button></td>
<td [ngClass]="{hidden: !showMeridian}" *ngIf="showMeridian"><button type="button" [ngClass]="{disabled: noToggleMeridian()}" class="btn btn-default text-center" (click)="toggleMeridian()">{{meridian}}</button></td>
</tr>
<tr class="text-center" [ngClass]="{hidden: !showSpinners}">
<td><a (click)="decrementHours()" [ngClass]="{disabled: noDecrementHours()}" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>
<td>&nbsp;</td>
<td><a (click)="decrementMinutes()" [ngClass]="{disabled: noDecrementMinutes()}" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>
<td [ngClass]="{hidden: !showMeridian}" [hidden]="!showMeridian"></td>
<td [ngClass]="{hidden: !showMeridian}" *ngIf="showMeridian"></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions demo/components/progressbar/progressbar-demo-bs4.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>Dynamic <button type="button" class="btn btn-sm btn-primary" (click)="random

<small><em>Object (changes type based on value)</em></small>
<progress class="progress progress-striped progress-animated active progress-{{ type }}" [value]="dynamic" [max]="max">
{{type}} <i [hidden]="!showWarning">!!! Watch out !!!</i>
{{type}} <i *ngIf="showWarning">!!! Watch out !!!</i>
</progress>

<hr />
Expand All @@ -34,7 +34,7 @@ <h3>Stacked <button type="button" class="btn btn-sm btn-primary" (click)="random
style="float: left;"
[ngStyle]="{width: baz.value + '%'}"
[value]="baz.value" [max]="baz.max">
<span [hidden]="baz.value < 5">{{baz?.value}}%</span>
<span *ngIf="baz.value > 3">{{baz?.value}}%</span>
</progress>
<!-- gray background -->
<progress class="progress" value="0" max="100" style="width: 100%;"></progress>
Expand Down
4 changes: 2 additions & 2 deletions demo/components/progressbar/progressbar-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>Dynamic
<progressbar [animate]="false" [value]="dynamic" type="success"><b>{{dynamic}}%</b></progressbar>

<small><em>Object (changes type based on value)</em></small>
<progressbar class="progress-striped active" [value]="dynamic" [type]="type">{{type}} <i [hidden]="!showWarning">!!!
<progressbar class="progress-striped active" [value]="dynamic" [type]="type">{{type}} <i *ngIf="showWarning">!!!
Watch out !!!</i></progressbar>

<hr/>
Expand All @@ -31,6 +31,6 @@ <h3>Stacked
</h3>
<bs-progress>
<bar *ngFor="#baz of stacked" [value]="baz.value" [type]="baz?.type">
<span [hidden]="baz.value < 5">{{baz?.value}}%</span>
<span *ngIf="baz.value > 5">{{baz?.value}}%</span>
</bar>
</bs-progress>
4 changes: 2 additions & 2 deletions demo/components/typeahead/typeahead-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ <h4>Asynchronous results</h4>
[typeaheadOptionsLimit]="7"
placeholder="Locations loaded with timeout"
class="form-control">
<div [hidden]="typeaheadLoading!==true">
<div *ngIf="typeaheadLoading===true">
<i class="glyphicon glyphicon-refresh ng-hide" style=""></i>
</div>
<div [hidden]="typeaheadNoResults!==true" class="" style="">
<div *ngIf="typeaheadNoResults===true" class="" style="">
<i class="glyphicon glyphicon-remove"></i> No Results Found
</div>
</div>

0 comments on commit 260e963

Please sign in to comment.