Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix datepicker theme(style) #16

Merged
merged 1 commit into from
Sep 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/datepicker/datepicker-inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const KEYS = {
})
@View({
template: `
<div [hidden]="!datepickerMode" class="well well-sm" role="application" ><!--&lt;!&ndash;ng-keydown="keydown($event)"&ndash;&gt;-->
<div [hidden]="!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
20 changes: 10 additions & 10 deletions components/datepicker/daypicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import {
Self, NgModel, Renderer
} from 'angular2/angular2';

import {Ng2BootstrapConfig} from '../ng2-bootstrap-config';
import {Ng2BootstrapConfig, Ng2BootstrapTheme} from '../ng2-bootstrap-config';
import {DatePickerInner} from './datepicker-inner';

const TEMPLATE_OPTIONS = {
bs4: {
[Ng2BootstrapTheme.BS4]: {
DAY_BUTTON: `
<button type="button" style="min-width:100%;" class="btn btn-sm"
[ng-class]="{'btn-info': dtz.selected, 'btn-link': !dtz.selected && !datePicker.isActive(dtz), 'btn-info': !dtz.selected && datePicker.isActive(dtz), disabled: dtz.disabled}"
[ng-class]="{'btn-secondary': !dtz.selected && !datePicker.isActive(dtz), 'btn-info': dtz.selected || !dtz.selected && datePicker.isActive(dtz), disabled: dtz.disabled}"
[disabled]="dtz.disabled"
(^click)="datePicker.select(dtz.date)" tabindex="-1">
<span [ng-class]="{'text-muted': dtz.secondary, 'text-success': dtz.current}">{{dtz.label}}</span>
<span [ng-class]="{'text-muted': dtz.secondary || dtz.current}">{{dtz.label}}</span>
</button>
`
},
bs3: {
[Ng2BootstrapTheme.BS3]: {
DAY_BUTTON: `
<button type="button" style="min-width:100%;" class="btn btn-default btn-sm"
[ng-class]="{'btn-info': dtz.selected, active: datePicker.isActive(dtz), disabled: dtz.disabled}"
Expand All @@ -47,13 +47,13 @@ const CURRENT_THEME_TEMPLATE = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme] || TEM
<thead>
<tr>
<th>
<button type="button" class="btn btn-default btn-sm pull-left" (^click)="datePicker.move(-1)" tabindex="-1">
<button type="button" class="btn btn-default btn-secondary btn-sm pull-left" (^click)="datePicker.move(-1)" tabindex="-1">
<i class="glyphicon glyphicon-chevron-left"></i>
</button>
</th>
<th colspan="5" [hidden]="datePicker.showWeeks">
<button [id]="datePicker.uniqueId + '-title'"
type="button" class="btn btn-default btn-sm"
type="button" class="btn btn-default btn-secondary btn-sm"
(^click)="datePicker.toggleMode()"
[disabled]="datePicker.datepickerMode === maxMode"
[ng-class]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">
Expand All @@ -62,22 +62,22 @@ const CURRENT_THEME_TEMPLATE = TEMPLATE_OPTIONS[Ng2BootstrapConfig.theme] || TEM
</th>
<th colspan="6" [hidden]="!datePicker.showWeeks">
<button [id]="datePicker.uniqueId + '-title'"
type="button" class="btn btn-default btn-sm"
type="button" class="btn btn-default btn-secondary btn-sm"
(^click)="datePicker.toggleMode()"
[disabled]="datePicker.datepickerMode === maxMode"
[ng-class]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">
<strong>{{title}}</strong>
</button>
</th>
<th>
<button type="button" class="btn btn-default btn-sm pull-right" (^click)="datePicker.move(1)" tabindex="-1">
<button type="button" class="btn btn-default btn-secondary btn-sm pull-right" (^click)="datePicker.move(1)" tabindex="-1">
<i class="glyphicon glyphicon-chevron-right"></i>
</button>
</th>
</tr>
<tr>
<th [hidden]="!datePicker.showWeeks" class="text-center"></th>
<th *ng-for="#labelz of labels" class="text-center"><small aria-label="labelz.full">{{labelz.abbr}}</small></th>
<th *ng-for="#labelz of labels" class="text-center"><small aria-label="labelz.full"><b>{{labelz.abbr}}</b></small></th>
</tr>
</thead>
<tbody>
Expand Down
4 changes: 2 additions & 2 deletions demo/components/datepicker/datepicker-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h4>Inline</h4>

<hr />
<button type="button" class="btn btn-sm btn-info" (click)="today()">Today</button>
<button type="button" class="btn btn-sm btn-default" (click)="d20090824();">2009-08-24</button>
<button type="button" class="btn btn-sm btn-default btn-secondary" (click)="d20090824();">2009-08-24</button>
<button type="button" class="btn btn-sm btn-danger" (click)="clear()">Clear</button>
<button type="button" class="btn btn-sm btn-default" (click)="toggleMin()" tooltip="After today restriction">Min date</button>
<button type="button" class="btn btn-sm btn-default btn-secondary" (click)="toggleMin()" tooltip="After today restriction">Min date</button>
</div>