Skip to content

Commit 63f65b1

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent bf243a8 commit 63f65b1

File tree

5 files changed

+797
-743
lines changed

5 files changed

+797
-743
lines changed

docs-aspnet/to_delete.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
layout: to_delete
3+
publish: False
4+
sitemap: false
5+
---

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9891,10 +9891,48 @@ The supported values are:
98919891

98929892
### series.autoFit `Boolean` *(default: false)*
98939893

9894-
If set to true, the Chart automatically scales down to fit the content area. Applicable for the Pie and Donut series ([see example]({% slug pietypecharts_widget %}#auto-fit-labels)).
9894+
If set to true, the Chart automatically scales down to fit the content area. Applicable for the Pie and Donut series.
98959895

98969896
> The `autoFit` option is supported when [series.type](/api/javascript/dataviz/ui/chart#configuration-series.type) is set to "pie" or "donut".
98979897

9898+
##### Example - set the chart series autoFit
9899+
9900+
<div id="chart" style="width: 200px;"></div>
9901+
<script>
9902+
var data = [{
9903+
kind: 'Solar', share: 0.052
9904+
}, {
9905+
kind: 'Wind', share: 0.225
9906+
}, {
9907+
kind: 'Other', share: 0.192
9908+
}, {
9909+
kind: 'Hydroelectric', share: 0.175
9910+
}, {
9911+
kind: 'Nuclear', share: 0.238
9912+
}, {
9913+
kind: 'Coal', share: 0.118
9914+
}];
9915+
9916+
$("#chart").kendoChart({
9917+
dataSource: { data: data },
9918+
series: [{
9919+
type: "pie",
9920+
field: "share",
9921+
categoryField: "kind",
9922+
autoFit: true,
9923+
labels: {
9924+
color: "#000",
9925+
position: "outsideEnd",
9926+
template: "#: category #",
9927+
visible: true
9928+
}
9929+
}],
9930+
legend: {
9931+
visible: false
9932+
}
9933+
});
9934+
</script>
9935+
98989936
### series.axis `String` *(default: "primary")*
98999937

99009938
The name of the value axis to use.

src/kendo.window.js

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
RESIZEEND = "resizeEnd",
6464
DRAGSTART = "dragstart",
6565
DRAGEND = "dragend",
66+
KENDOKEYDOWN = "kendoKeydown",
6667
ERROR = "error",
6768
OVERFLOW = "overflow",
6869
DATADOCOVERFLOWRULE = "original-overflow-rule",
@@ -220,7 +221,6 @@
220221
}
221222

222223
windowContent = wrapper.children(KWINDOWCONTENT);
223-
that._tabindex(windowContent);
224224

225225
if (options.visible && options.modal) {
226226
that._overlay(wrapper.is(VISIBLE)).css({ opacity: 0.5 });
@@ -230,14 +230,12 @@
230230
.on("mouseenter" + NS, TITLEBAR_BUTTONS, proxy(that._buttonEnter, that))
231231
.on("mouseleave" + NS, TITLEBAR_BUTTONS, proxy(that._buttonLeave, that))
232232
.on("click" + NS, "> " + TITLEBAR_BUTTONS, proxy(that._windowActionHandler, that))
233-
.on("keydown" + NS, proxy(that._keydown, that))
233+
.on("keydown" + NS, that, proxy(that._keydown, that))
234234
.on("focus" + NS, proxy(that._focus, that))
235235
.on("blur" + NS, proxy(that._blur, that));
236236

237237
windowContent
238-
.on("keydown" + NS, proxy(that._keydown, that))
239-
.on("focus" + NS, proxy(that._focus, that))
240-
.on("blur" + NS, proxy(that._blur, that));
238+
.on("keydown" + NS, that, proxy(that._keydownContent, that));
241239

242240
windowFrame = windowContent.find("." + KCONTENTFRAME)[0];
243241

@@ -304,7 +302,7 @@
304302
this._tabKeyTrap = new TabKeyTrap(wrapper);
305303
this._tabKeyTrap.trap();
306304
this._tabKeyTrap.shouldTrap = function () {
307-
return windowContent.data("isFront");
305+
return wrapper.data("isFront");
308306
};
309307
}
310308
},
@@ -553,6 +551,7 @@
553551
RESIZEEND,
554552
DRAGSTART,
555553
DRAGEND,
554+
KENDOKEYDOWN,
556555
ERROR
557556
],
558557

@@ -596,6 +595,17 @@
596595
return $.inArray("close", $.map(this.options.actions, function(x) { return x.toLowerCase(); })) > -1;
597596
},
598597

598+
_keydownContent: function(e) {
599+
var that = this,
600+
keys = kendo.keys,
601+
keyCode = e.keyCode;
602+
603+
if (keyCode == keys.ESC && that._closable()) {
604+
e.stopPropagation();
605+
that._close(false);
606+
}
607+
},
608+
599609
_keydown: function(e) {
600610
var that = this,
601611
options = that.options,
@@ -635,19 +645,20 @@
635645
if(e.altKey && keyCode == keys.UP){
636646
if (isMinimized) {
637647
that.restore();
638-
that.element.focus();
648+
that.wrapper.focus();
639649
} else if (!isMaximized) {
640650
that.maximize();
641-
that.element.focus();
651+
that.wrapper.focus();
642652
}
653+
643654
} else if (e.altKey && keyCode == keys.DOWN){
644655
if (!isMinimized && !isMaximized) {
645656
that.minimize();
646657
that.wrapper.focus();
647658
} else if (isMaximized) {
648659
that.restore();
649-
that.element.focus();
650660
}
661+
651662
}
652663

653664
offset = kendo.getOffset(wrapper);
@@ -950,7 +961,7 @@
950961
that.toFront();
951962

952963
if (options.autoFocus) {
953-
that.element.focus();
964+
that.wrapper.focus();
954965
}
955966

956967
options.visible = true;
@@ -973,8 +984,8 @@
973984
overlay.show();
974985

975986
$(window).on("focus" + MODAL_NS, function() {
976-
if (contentElement.data("isFront") && !$(document.activeElement).closest(contentElement).length) {
977-
that.element.focus();
987+
if (wrapper.data("isFront") && !$(document.activeElement).closest(wrapper).length) {
988+
that.wrapper.focus();
978989
}
979990
});
980991
}
@@ -1009,7 +1020,7 @@
10091020
var scrollable = this.options.scrollable !== false;
10101021

10111022
if (this.options.autoFocus) {
1012-
this.element.focus();
1023+
this.wrapper.focus();
10131024
}
10141025

10151026
this.element.css(OVERFLOW, scrollable ? "" : "hidden");
@@ -1123,7 +1134,7 @@
11231134

11241135
_shouldFocus: function(target) {
11251136
var active = activeElement(),
1126-
element = this.element;
1137+
element = this.wrapper;
11271138

11281139
return this.options.autoFocus &&
11291140
!$(active).is(element) &&
@@ -1149,7 +1160,7 @@
11491160
zIndex = Math.max(+zIndexNew, zIndex);
11501161
}
11511162

1152-
contentElement.data("isFront", element == currentWindow);
1163+
wrapper.data("isFront", element == currentWindow);
11531164
// Add overlay to windows with iframes and lower z-index to prevent
11541165
// trapping of events when resizing / dragging
11551166
if (element != currentWindow && contentElement.find("> ." + KCONTENTFRAME).length > 0) {
@@ -1163,15 +1174,9 @@
11631174
that.element.find("> .k-overlay").remove();
11641175

11651176
if (that._shouldFocus(target)) {
1166-
if (that.isMinimized()) {
1177+
setTimeout(function(){
11671178
that.wrapper.focus();
1168-
} else if ($(target).is(KOVERLAY)) {
1169-
setTimeout(function(){
1170-
that.element.focus();
1171-
});
1172-
} else {
1173-
that.element.focus();
1174-
}
1179+
});
11751180

11761181
var scrollTop = containmentContext ? that.containment.scrollTop() : $(window).scrollTop(),
11771182
windowTop = parseInt(wrapper.position().top, 10);
@@ -1265,7 +1270,6 @@
12651270

12661271
options.isMaximized = options.isMinimized = false;
12671272

1268-
that.wrapper.removeAttr("tabindex");
12691273
that.wrapper.removeAttr("aria-labelled-by");
12701274

12711275
that.resize();
@@ -1423,7 +1427,6 @@
14231427
that.options.isMinimized = true;
14241428
});
14251429

1426-
this.wrapper.attr("tabindex", 0);
14271430
this.wrapper.attr("aria-labelled-by", this.element.attr("aria-labelled-by"));
14281431

14291432
this._updateBoundaries();
@@ -1715,6 +1718,7 @@
17151718
// Make sure the wrapper is appended to the body only once. IE9+ will throw exceptions if you move iframes in DOM
17161719
wrapper
17171720
.toggleClass("k-rtl", isRtl)
1721+
.attr("tabindex", 0)
17181722
.append(contentHtml)
17191723
.find("iframe:not(.k-content-frame)").each(function(index) {
17201724
// Restore the src attribute of the iframes when they are part of the live DOM tree

0 commit comments

Comments
 (0)