Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

Commit

Permalink
build: release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Jan 19, 2019
1 parent 85f7cc4 commit 32b1f86
Show file tree
Hide file tree
Showing 12 changed files with 672 additions and 312 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

# next
## 1.0.5 (Jan 19, 2019)

- Emulate click in touch devices to support hiding the picker automatically (#197).

Expand Down
26 changes: 23 additions & 3 deletions dist/datepicker.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:36.188Z
* Date: 2019-01-19T07:06:03.574Z
*/

'use strict';
Expand Down Expand Up @@ -104,7 +104,9 @@ var DEFAULTS = {
pick: null
};

var WINDOW = typeof window !== 'undefined' ? window : {};
var IS_BROWSER = typeof window !== 'undefined';
var WINDOW = IS_BROWSER ? window : {};
var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
var NAMESPACE = 'datepicker';
var EVENT_CLICK = "click.".concat(NAMESPACE);
var EVENT_FOCUS = "focus.".concat(NAMESPACE);
Expand All @@ -114,6 +116,7 @@ var EVENT_PICK = "pick.".concat(NAMESPACE);
var EVENT_RESIZE = "resize.".concat(NAMESPACE);
var EVENT_SCROLL = "scroll.".concat(NAMESPACE);
var EVENT_SHOW = "show.".concat(NAMESPACE);
var EVENT_TOUCH_START = "touchstart.".concat(NAMESPACE);
var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
var LANGUAGES = {};
var VIEWS = {
Expand Down Expand Up @@ -760,6 +763,15 @@ var handlers = {
if (this.isInput && target !== this.element && this.shown && (key === 'Tab' || keyCode === 9)) {
this.hide();
}
},
touchstart: function touchstart(_ref3) {
var target = _ref3.target;

// Emulate click in touch devices to support hiding the picker automatically (#197).
if (this.isInput && target !== this.element && !$.contains(this.$picker, target)) {
this.hide();
this.element.blur();
}
}
};

Expand Down Expand Up @@ -1229,6 +1241,10 @@ function () {
} else {
$this.on(EVENT_CLICK, $.proxy(this.show, this));
}

if (IS_TOUCH_DEVICE) {
$(document).on(EVENT_TOUCH_START, $.proxy(this.touchstart, this));
}
}
}
}, {
Expand Down Expand Up @@ -1261,6 +1277,10 @@ function () {
} else {
$this.off(EVENT_CLICK, this.show);
}

if (IS_TOUCH_DEVICE) {
$(document).off(EVENT_TOUCH_START, this.touchstart);
}
}
}
}, {
Expand Down
4 changes: 2 additions & 2 deletions dist/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:32.803Z
* Date: 2019-01-19T07:05:59.993Z
*/

.datepicker-container {
Expand Down
26 changes: 23 additions & 3 deletions dist/datepicker.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:36.188Z
* Date: 2019-01-19T07:06:03.574Z
*/

import $ from 'jquery';
Expand Down Expand Up @@ -100,7 +100,9 @@ var DEFAULTS = {
pick: null
};

var WINDOW = typeof window !== 'undefined' ? window : {};
var IS_BROWSER = typeof window !== 'undefined';
var WINDOW = IS_BROWSER ? window : {};
var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
var NAMESPACE = 'datepicker';
var EVENT_CLICK = "click.".concat(NAMESPACE);
var EVENT_FOCUS = "focus.".concat(NAMESPACE);
Expand All @@ -110,6 +112,7 @@ var EVENT_PICK = "pick.".concat(NAMESPACE);
var EVENT_RESIZE = "resize.".concat(NAMESPACE);
var EVENT_SCROLL = "scroll.".concat(NAMESPACE);
var EVENT_SHOW = "show.".concat(NAMESPACE);
var EVENT_TOUCH_START = "touchstart.".concat(NAMESPACE);
var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
var LANGUAGES = {};
var VIEWS = {
Expand Down Expand Up @@ -756,6 +759,15 @@ var handlers = {
if (this.isInput && target !== this.element && this.shown && (key === 'Tab' || keyCode === 9)) {
this.hide();
}
},
touchstart: function touchstart(_ref3) {
var target = _ref3.target;

// Emulate click in touch devices to support hiding the picker automatically (#197).
if (this.isInput && target !== this.element && !$.contains(this.$picker, target)) {
this.hide();
this.element.blur();
}
}
};

Expand Down Expand Up @@ -1225,6 +1237,10 @@ function () {
} else {
$this.on(EVENT_CLICK, $.proxy(this.show, this));
}

if (IS_TOUCH_DEVICE) {
$(document).on(EVENT_TOUCH_START, $.proxy(this.touchstart, this));
}
}
}
}, {
Expand Down Expand Up @@ -1257,6 +1273,10 @@ function () {
} else {
$this.off(EVENT_CLICK, this.show);
}

if (IS_TOUCH_DEVICE) {
$(document).off(EVENT_TOUCH_START, this.touchstart);
}
}
}
}, {
Expand Down
26 changes: 23 additions & 3 deletions dist/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:36.188Z
* Date: 2019-01-19T07:06:03.574Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -106,7 +106,9 @@
pick: null
};

var WINDOW = typeof window !== 'undefined' ? window : {};
var IS_BROWSER = typeof window !== 'undefined';
var WINDOW = IS_BROWSER ? window : {};
var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
var NAMESPACE = 'datepicker';
var EVENT_CLICK = "click.".concat(NAMESPACE);
var EVENT_FOCUS = "focus.".concat(NAMESPACE);
Expand All @@ -116,6 +118,7 @@
var EVENT_RESIZE = "resize.".concat(NAMESPACE);
var EVENT_SCROLL = "scroll.".concat(NAMESPACE);
var EVENT_SHOW = "show.".concat(NAMESPACE);
var EVENT_TOUCH_START = "touchstart.".concat(NAMESPACE);
var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
var LANGUAGES = {};
var VIEWS = {
Expand Down Expand Up @@ -762,6 +765,15 @@
if (this.isInput && target !== this.element && this.shown && (key === 'Tab' || keyCode === 9)) {
this.hide();
}
},
touchstart: function touchstart(_ref3) {
var target = _ref3.target;

// Emulate click in touch devices to support hiding the picker automatically (#197).
if (this.isInput && target !== this.element && !$.contains(this.$picker, target)) {
this.hide();
this.element.blur();
}
}
};

Expand Down Expand Up @@ -1231,6 +1243,10 @@
} else {
$this.on(EVENT_CLICK, $.proxy(this.show, this));
}

if (IS_TOUCH_DEVICE) {
$(document).on(EVENT_TOUCH_START, $.proxy(this.touchstart, this));
}
}
}
}, {
Expand Down Expand Up @@ -1263,6 +1279,10 @@
} else {
$this.off(EVENT_CLICK, this.show);
}

if (IS_TOUCH_DEVICE) {
$(document).off(EVENT_TOUCH_START, this.touchstart);
}
}
}
}, {
Expand Down
4 changes: 2 additions & 2 deletions dist/datepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/datepicker.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:32.803Z
* Date: 2019-01-19T07:05:59.993Z
*/

.datepicker-container {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Datepicker <small class="h6">v1.0.4</small></h1>
<h1>Datepicker <small class="h6">v1.0.5</small></h1>
<p class="lead">A simple jQuery datepicker plugin.</p>
</div>
<div class="col-md">
Expand Down
26 changes: 23 additions & 3 deletions docs/js/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v1.0.4
* Datepicker v1.0.5
* https://fengyuanchen.github.io/datepicker
*
* Copyright 2014-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-01-06T02:42:36.188Z
* Date: 2019-01-19T07:06:03.574Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -106,7 +106,9 @@
pick: null
};

var WINDOW = typeof window !== 'undefined' ? window : {};
var IS_BROWSER = typeof window !== 'undefined';
var WINDOW = IS_BROWSER ? window : {};
var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
var NAMESPACE = 'datepicker';
var EVENT_CLICK = "click.".concat(NAMESPACE);
var EVENT_FOCUS = "focus.".concat(NAMESPACE);
Expand All @@ -116,6 +118,7 @@
var EVENT_RESIZE = "resize.".concat(NAMESPACE);
var EVENT_SCROLL = "scroll.".concat(NAMESPACE);
var EVENT_SHOW = "show.".concat(NAMESPACE);
var EVENT_TOUCH_START = "touchstart.".concat(NAMESPACE);
var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
var LANGUAGES = {};
var VIEWS = {
Expand Down Expand Up @@ -762,6 +765,15 @@
if (this.isInput && target !== this.element && this.shown && (key === 'Tab' || keyCode === 9)) {
this.hide();
}
},
touchstart: function touchstart(_ref3) {
var target = _ref3.target;

// Emulate click in touch devices to support hiding the picker automatically (#197).
if (this.isInput && target !== this.element && !$.contains(this.$picker, target)) {
this.hide();
this.element.blur();
}
}
};

Expand Down Expand Up @@ -1231,6 +1243,10 @@
} else {
$this.on(EVENT_CLICK, $.proxy(this.show, this));
}

if (IS_TOUCH_DEVICE) {
$(document).on(EVENT_TOUCH_START, $.proxy(this.touchstart, this));
}
}
}
}, {
Expand Down Expand Up @@ -1263,6 +1279,10 @@
} else {
$this.off(EVENT_CLICK, this.show);
}

if (IS_TOUCH_DEVICE) {
$(document).off(EVENT_TOUCH_START, this.touchstart);
}
}
}
}, {
Expand Down
Loading

0 comments on commit 32b1f86

Please sign in to comment.