Skip to content

Commit 51df02e

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 19ed852 commit 51df02e

File tree

4 files changed

+57
-22
lines changed

4 files changed

+57
-22
lines changed

docs/api/javascript/dataviz/ui/chart.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9046,6 +9046,28 @@ Sets the title of the PDF file.
90469046
chart.saveAsPDF();
90479047
</script>
90489048

9049+
### persistSeriesVisibility `Boolean` *(default: false)*
9050+
9051+
Specifies if the series visible option should be persisted when changing the dataSource data.
9052+
9053+
#### Example - persist visibility when changing the data
9054+
<div id="chart"></div>
9055+
<script>
9056+
$("#chart").kendoChart({
9057+
persistSeriesVisibility: true,
9058+
dataSource: [{ value: 1 }, { value: 2 }],
9059+
series: [
9060+
{ name: "Series 1", field: "value" },
9061+
{ name: "Series 2", field: "value" }
9062+
]
9063+
});
9064+
9065+
var chart = $("#chart").getKendoChart();
9066+
9067+
chart.findSeriesByIndex(1).toggleVisibility(false);
9068+
chart.dataSource.data([{ value: 3 }, { value: 4 }]);
9069+
</script>
9070+
90499071
### plotArea `Object`
90509072

90519073
The plot area configuration options. The plot area is the area which displays the series.

docs/api/javascript/dataviz/ui/stock-chart.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5489,6 +5489,10 @@ Sets the title of the PDF file.
54895489
chart.saveAsPDF();
54905490
</script>
54915491

5492+
### persistSeriesVisibility `Boolean` *(default: true)*
5493+
5494+
Specifies if the series visible option should be persisted when changing the dataSource data.
5495+
54925496
### plotArea `Object`
54935497

54945498
The plot area configuration options. This is the area containing the plotted series.

src/kendo.datepicker.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ var __meta__ = { // jshint ignore:line
1616
Widget = ui.Widget,
1717
parse = kendo.parseDate,
1818
keys = kendo.keys,
19+
support = kendo.support,
1920
template = kendo.template,
2021
activeElement = kendo._activeElement,
2122
DIV = "<div />",
2223
SPAN = "<span />",
2324
ns = ".kendoDatePicker",
2425
CLICK = "click" + ns,
26+
UP = support.mouseAndTouchPresent ? kendo.applyEventMap("up", ns.slice(1)) : CLICK,
2527
OPEN = "open",
2628
CLOSE = "close",
2729
CHANGE = "change",
@@ -445,7 +447,7 @@ var __meta__ = { // jshint ignore:line
445447
that._inputWrapper.addClass(FOCUSED);
446448
});
447449

448-
icon.on(CLICK, proxy(that._click, that))
450+
icon.on(UP, proxy(that._click, that))
449451
.on(MOUSEDOWN, preventDefault);
450452
} else {
451453
wrapper
@@ -536,13 +538,17 @@ var __meta__ = { // jshint ignore:line
536538
that._inputWrapper.removeClass(FOCUSED);
537539
},
538540

539-
_click: function() {
540-
var that = this,
541-
element = that.element;
541+
_click: function(e) {
542+
var that = this;
542543

543544
that.dateView.toggle();
545+
that._focusElement(e.type);
546+
},
547+
548+
_focusElement: function(eventType) {
549+
var element = this.element;
544550

545-
if (!kendo.support.touch && element[0] !== activeElement()) {
551+
if ((!support.touch || (support.mouseAndTouchPresent && !(eventType || "").match(/touch/i))) && element[0] !== activeElement()) {
546552
element.focus();
547553
}
548554
},

src/kendo.datetimepicker.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var __meta__ = { // jshint ignore:line
1515
var kendo = window.kendo,
1616
TimeView = kendo.TimeView,
1717
parse = kendo.parseDate,
18+
support = kendo.support,
1819
activeElement = kendo._activeElement,
1920
extractFormat = kendo._extractFormat,
2021
calendar = kendo.calendar,
@@ -29,6 +30,7 @@ var __meta__ = { // jshint ignore:line
2930
CHANGE = "change",
3031
ns = ".kendoDateTimePicker",
3132
CLICK = "click" + ns,
33+
UP = support.mouseAndTouchPresent ? kendo.applyEventMap("up", ns.slice(1)) : CLICK,
3234
DISABLED = "disabled",
3335
READONLY = "readonly",
3436
DEFAULT = "k-state-default",
@@ -138,13 +140,13 @@ var __meta__ = { // jshint ignore:line
138140
timeButtonText: "Open the time view",
139141
dateInput: false,
140142
weekNumber: false
141-
},
143+
},
142144

143-
events: [
144-
OPEN,
145-
CLOSE,
146-
CHANGE
147-
],
145+
events: [
146+
OPEN,
147+
CLOSE,
148+
CHANGE
149+
],
148150

149151
setOptions: function(options) {
150152
var that = this,
@@ -218,22 +220,15 @@ var __meta__ = { // jshint ignore:line
218220
});
219221

220222
dateIcon.on(MOUSEDOWN, preventDefault)
221-
.on(CLICK, function() {
223+
.on(UP, function(e) {
222224
that.toggle("date");
223-
224-
if (!kendo.support.touch && element[0] !== activeElement()) {
225-
element.focus();
226-
}
225+
that._focusElement(e.type);
227226
});
228227

229-
230228
timeIcon.on(MOUSEDOWN, preventDefault)
231-
.on(CLICK, function() {
229+
.on(UP, function(e) {
232230
that.toggle("time");
233-
234-
if (!kendo.support.touch && element[0] !== activeElement()) {
235-
element.focus();
236-
}
231+
that._focusElement(e.type);
237232
});
238233

239234
} else {
@@ -247,6 +242,14 @@ var __meta__ = { // jshint ignore:line
247242
}
248243
},
249244

245+
_focusElement: function(eventType) {
246+
var element = this.element;
247+
248+
if ((!support.touch || (support.mouseAndTouchPresent && !(eventType || "").match(/touch/i))) && element[0] !== activeElement()) {
249+
element.focus();
250+
}
251+
},
252+
250253
readonly: function(readonly) {
251254
this._editable({
252255
readonly: readonly === undefined ? true : readonly,

0 commit comments

Comments
 (0)