Skip to content

Commit

Permalink
Rename themeClass to theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
rikkert committed Feb 18, 2015
1 parent 1b53c9c commit b31c8f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.4.0 - TBA

- Add theme class support, see #260

## 1.3.2 - 2015-02-17

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Pikaday has many useful options:
* `showMonthAfterYear` render the month after year in the title (default `false`)
* `numberOfMonths` number of visible calendars
* `mainCalendar` when `numberOfMonths` is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`). Only used for the first display or when a selected date is not already visible
* `themeClass` define a classname that can be used as a hook for styling different themes, see [theme example][]
* `theme` define a classname that can be used as a hook for styling different themes, see [theme example][] (default `null`)
* `onSelect` callback function for when a date is selected
* `onOpen` callback function for when the picker becomes visible
* `onClose` callback function for when the picker is hidden
Expand Down
4 changes: 2 additions & 2 deletions examples/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2>What is this?</h2>
<script src="../pikaday.js"></script>
<script>

// You can use different themes with the `themeClass` option
// You can use different themes with the `theme` option
var pickerDefault = new Pikaday(
{
field: document.getElementById('datepicker'),
Expand All @@ -42,7 +42,7 @@ <h2>What is this?</h2>
var pickerTheme = new Pikaday(
{
field: document.getElementById('datepicker-theme'),
themeClass: 'dark-theme'
theme: 'dark-theme'
});

</script>
Expand Down
6 changes: 3 additions & 3 deletions pikaday.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
},

// Theme Classname
themeClass: null,
theme: null,

// callback function
onSelect: null,
Expand Down Expand Up @@ -527,7 +527,7 @@
};

self.el = document.createElement('div');
self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.themeClass ? ' ' + opts.themeClass : '');
self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');

addEvent(self.el, 'mousedown', self._onMouseDown, true);
addEvent(self.el, 'change', self._onChange);
Expand Down Expand Up @@ -597,7 +597,7 @@

opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;

opts.themeClass = (typeof opts.themeClass === 'string' && opts.themeClass) ? opts.themeClass : null;
opts.theme = (typeof opts.theme) == 'string' && opts.theme ? opts.theme : null;

opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);

Expand Down

0 comments on commit b31c8f8

Please sign in to comment.