Skip to content

Commit

Permalink
Merge pull request #16 from natali-abyss/fix-datepicker-theme
Browse files Browse the repository at this point in the history
fix datepicker theme(style)
  • Loading branch information
valorkin committed Sep 8, 2015
2 parents 4143968 + 62bdec8 commit 8d54288
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
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>

0 comments on commit 8d54288

Please sign in to comment.