Comparing version 1.0.4 to 1.0.5
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.0.5] - 2018-07-12 | ||
* new method `reloadOptions` (by Codetaal) | ||
* fixed bug #5 | ||
[1.0.4] - 2018-07-12 | ||
@@ -8,3 +12,3 @@ * Improves CSS (by bartvandebiezen) | ||
[1.0.3] - 2018-07-09 | ||
* fixed bug: preventing pick a one-day-range when `minDays` option | ||
* fixed bug #1: preventing pick a one-day-range when `minDays` option | ||
@@ -11,0 +15,0 @@ [1.0.2] - 2018-06-20 |
@@ -319,2 +319,6 @@ /** | ||
if (opts.parentEl !== 'body') { | ||
self.el.className += ' has-parent-el'; | ||
} | ||
self.el.innerHTML = '<div class="lightpick__inner">' | ||
@@ -479,6 +483,7 @@ + (opts.numberOfMonths > 1 ? renderTopButtons(opts) : '') | ||
if (days > 0 && !target.classList.contains('is-disabled')) { | ||
var dayBounding = target.getBoundingClientRect(), | ||
pickerBouding = self.el.getBoundingClientRect(), | ||
_left = (dayBounding.left - pickerBouding.left) + (dayBounding.width / 2), | ||
_top = dayBounding.top - pickerBouding.top; | ||
var hasParentEl = self.el.classList.contains('has-parent-el'), | ||
dayBounding = target.getBoundingClientRect(), | ||
pickerBouding = hasParentEl ? self.el.parentNode.getBoundingClientRect() : self.el.getBoundingClientRect(), | ||
_left = (dayBounding.left - pickerBouding.left) + (dayBounding.width / 2), | ||
_top = dayBounding.top - pickerBouding.top; | ||
@@ -704,2 +709,4 @@ tooltip.style.visibility = 'visible'; | ||
updatePosition: function(){ | ||
if (this.el.classList.contains('has-parent-el')) return; | ||
var rect = this._opts.field.getBoundingClientRect(); | ||
@@ -891,3 +898,8 @@ | ||
} | ||
}, | ||
reloadOptions: function(options) { | ||
this._opts = Object.assign({}, this._opts, options); | ||
} | ||
}; | ||
@@ -894,0 +906,0 @@ |
{ | ||
"name": "lightpick", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "main": "lightpick.js", |
@@ -217,3 +217,2 @@ [![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) | ||
### picker.getStartDate() | ||
@@ -227,2 +226,10 @@ | ||
### picker.toString('YYYY-MM-DD') | ||
Returns the date in a string format. | ||
### picker.reloadOptions({}) | ||
Update picker options. | ||
### picker.show() | ||
@@ -229,0 +236,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
74866
1050
243