From c683a7b2684b49195fc4556f71b6f9e407ad585a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=99=94?= Date: Mon, 16 May 2016 12:22:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20bug:=20Calendar=E6=9C=AA=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=87=E6=A1=A3=E4=B8=AD=E5=86=99=E7=9A=84closeByOu?= =?UTF-8?q?tsideClick=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/calendar.js b/src/js/calendar.js index 56be554..20035c7 100644 --- a/src/js/calendar.js +++ b/src/js/calendar.js @@ -678,7 +678,7 @@ } //iphone 上无法正确触发 click,会导致点击外面无法关闭 - if (!p.inline) $(document).on('click touchend', closeOnHTMLClick); + if (!p.inline && p.params.closeByOutsideClick) $(document).on('click touchend', closeOnHTMLClick); // Open function onPickerClose() { @@ -827,6 +827,7 @@ touchMove: true, animate: true, closeOnSelect: true, + closeByOutsideClick: true, monthPicker: true, monthPickerTemplate: '
' + From cab5a9ead7ca3eccb8dfe4d7c45f1223ef1e6e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=99=94?= Date: Mon, 16 May 2016 12:29:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4calendar=E4=B8=ADonChange?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E7=9A=84=E8=B0=83=E7=94=A8=E6=97=B6=E6=9C=BA?= =?UTF-8?q?=EF=BC=8C=E6=96=B9=E4=BE=BF=E7=94=A8=E6=88=B7=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/calendar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/calendar.js b/src/js/calendar.js index 20035c7..7b88c43 100644 --- a/src/js/calendar.js +++ b/src/js/calendar.js @@ -108,9 +108,6 @@ var valueDate = new Date(p.value[i]); p.wrapper.find('.picker-calendar-day[data-date="' + valueDate.getFullYear() + '-' + valueDate.getMonth() + '-' + valueDate.getDate() + '"]').addClass('picker-calendar-day-selected'); } - if (p.params.onChange) { - p.params.onChange(p, p.value, p.value.map(formatDate)); - } if (p.input && p.input.length > 0) { if (p.params.formatValue) inputValue = p.params.formatValue(p, p.value); else { @@ -123,6 +120,9 @@ $(p.input).val(inputValue); $(p.input).trigger('change'); } + if (p.params.onChange) { + p.params.onChange(p, p.value, p.value.map(formatDate)); + } }; // Columns Handlers