Comparing version 1.0.7 to 1.0.8
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.0.8] - 2018-07-12 | ||
* new option `hideOnBodyClick` (by ninty9notout) | ||
* fixed bug #7 | ||
[1.0.6] - 2018-07-12 | ||
@@ -5,0 +9,0 @@ * Improves styling (by bartvandebiezen) |
@@ -83,2 +83,3 @@ /** | ||
hoveringTooltip: true, | ||
hideOnBodyClick: true, | ||
locale: { | ||
@@ -579,3 +580,3 @@ buttons: { | ||
if (self.isShowing && target !== opts.field && parentEl !== opts.field) { | ||
if (self.isShowing && opts.hideOnBodyClick && target !== opts.field && parentEl !== opts.field) { | ||
self.hide(); | ||
@@ -749,3 +750,3 @@ } | ||
} | ||
else if (!this._opts.singleDate) { | ||
else if (!this._opts.singleDate && this._opts.startDate) { | ||
this._opts.field.value = this._opts.startDate.format(this._opts.format) + this._opts.separator + '...' | ||
@@ -785,2 +786,6 @@ } | ||
if (this.isShowing) { | ||
updateDates(this.el, this._opts); | ||
} | ||
if (!preventOnSelect && typeof this._opts.onSelect === 'function') { | ||
@@ -886,10 +891,10 @@ this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate()); | ||
opts.field.removeEventListener('change', self._onInputChange); | ||
opts.field.removeEventListener('click', self._onInputClick); | ||
opts.field.removeEventListener('focus', self._onInputFocus); | ||
opts.field.removeEventListener('change', this._onInputChange); | ||
opts.field.removeEventListener('click', this._onInputClick); | ||
opts.field.removeEventListener('focus', this._onInputFocus); | ||
if (opts.secondField) { | ||
opts.secondField.removeEventListener('change', self._onInputChange); | ||
opts.secondField.removeEventListener('click', self._onInputClick); | ||
opts.secondField.removeEventListener('focus', self._onInputFocus); | ||
opts.secondField.removeEventListener('change', this._onInputChange); | ||
opts.secondField.removeEventListener('click', this._onInputClick); | ||
opts.secondField.removeEventListener('focus', this._onInputFocus); | ||
} | ||
@@ -896,0 +901,0 @@ |
{ | ||
"name": "lightpick", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "main": "lightpick.js", |
@@ -119,2 +119,8 @@ [![npm version](https://badge.fury.io/js/lightpick.svg)](https://www.npmjs.com/package/lightpick) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wakirin/lightpick/blob/master/LICENSE) | ||
### hideOnBodyClick | ||
- Type: `Boolean` | ||
- Default: `true` | ||
Close calendar when clicked outside the elements specified in `field` or `parentEl`. Recommended use when `autoclose` is set to `false`. | ||
### repick | ||
@@ -244,2 +250,2 @@ - Type: `Boolean` | ||
Hide the picker and remove all event listeners. | ||
Hide the picker and remove all event listeners. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89890
1489
250