Skip to content

Commit 3b7f2b7

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 16bde8e commit 3b7f2b7

File tree

6 files changed

+102
-47
lines changed

6 files changed

+102
-47
lines changed

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

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,18 @@ horizontal gauge is 200px.
109109
The pointer configuration options. It accepts an `Array` of pointers, each with it's own configuration options.
110110

111111
#### Example - specify single pointer
112+
112113
<div id="gauge"></div>
113114
<script>
114115
$("#gauge").kendoLinearGauge({
115116
pointer: {
116117
value: 40
117118
}
118119
});
119-
<script>
120+
</script>
120121

121122
#### Example - specify multiple pointers
123+
122124
<div id="gauge"></div>
123125
<script>
124126
$("#gauge").kendoLinearGauge({
@@ -128,7 +130,7 @@ The pointer configuration options. It accepts an `Array` of pointers, each with
128130
value: 40
129131
}]
130132
});
131-
<script>
133+
</script>
132134

133135
### pointer.border `Object`
134136

@@ -430,12 +432,14 @@ The format of the labels.
430432

431433
#### Example
432434

435+
<div id="linear-gauge"></div>
436+
<script>
433437
$("#linear-gauge").kendoLinearGauge({
434438
scale: {
435-
labels: {
436-
// set the format to currency
437-
format: "C"
438-
}
439+
labels: {
440+
// set the format to currency
441+
format: "C"
442+
}
439443
}
440444
});
441445

@@ -498,14 +502,16 @@ Template variables:
498502

499503
#### Example
500504

501-
// chart initialization
505+
<div id="linear-gauge"></div>
506+
<script>
507+
// gauge initialization
502508
$("#linear-gauge").kendoLinearGauge({
503-
scale: {
504-
labels: {
505-
// labels template
506-
template: "#= value #%"
507-
}
508-
}
509+
scale: {
510+
labels: {
511+
// labels template
512+
template: "#= value #%"
513+
}
514+
}
509515
});
510516

511517
### scale.labels.visible `Boolean`*(default: true)*
@@ -583,8 +589,10 @@ The ranges of the scale.
583589

584590
#### Example
585591

586-
$("#linear-gauge").kendoLinearGauge({
587-
scale: {
592+
<div id="linear-gauge"></div>
593+
<script>
594+
$("#linear-gauge").kendoLinearGauge({
595+
scale: {
588596
ranges: [{
589597
from: 10,
590598
to: 20,
@@ -666,32 +674,32 @@ An array of values to be set.
666674
#### Example - setting multiple values
667675
<div id="gauge"></div>
668676
<script>
669-
$("#gauge").kendoLinearGauge({
677+
$("#gauge").kendoLinearGauge({
670678
pointer: [{
671-
value: 20
679+
value: 20
672680
}, {
673-
value: 40
681+
value: 40
674682
}]
675-
});
683+
});
676684

677-
var gauge = $("#gauge").data("kendoLinearGauge");
678-
gauge.allValues([60, 10]);
679-
<script>
685+
var gauge = $("#gauge").data("kendoLinearGauge");
686+
gauge.allValues([60, 10]);
687+
</script>
680688

681689
#### Example - retrieving all values
682690
<div id="gauge"></div>
683691
<script>
684-
$("#gauge").kendoLinearGauge({
692+
$("#gauge").kendoLinearGauge({
685693
pointer: [{
686-
value: 20
694+
value: 20
687695
}, {
688-
value: 40
696+
value: 40
689697
}]
690-
});
698+
});
691699

692-
var gauge = $("#gauge").data("kendoLinearGauge");
693-
var allValues = gauge.allValues();
694-
<script>
700+
var gauge = $("#gauge").data("kendoLinearGauge");
701+
var allValues = gauge.allValues();
702+
</script>
695703

696704
### destroy
697705

@@ -721,6 +729,7 @@ The height of the exported image. Defaults to the Gauge height.
721729
`Promise` A promise that will be resolved with a PNG image encoded as a Data URI.
722730

723731
#### Example - Exporting a Gauge to an image
732+
724733
<div id="gauge"></div>
725734
<script>
726735
$("#gauge").kendoLinearGauge({
@@ -742,7 +751,6 @@ The height of the exported image. Defaults to the Gauge height.
742751
});
743752
</script>
744753

745-
746754
### exportPDF
747755
Exports the Gauge as a PDF file.
748756
The result can be saved using [kendo.saveAs](/api/javascript/kendo/methods/saveas).
@@ -759,6 +767,7 @@ Parameters for the exported PDF file.
759767
`Promise` A promise that will be resolved with a PDF file encoded as a Data URI.
760768

761769
#### Example - Exporting a chart to a PDF file
770+
762771
<div id="gauge"></div>
763772
<script>
764773
$("#gauge").kendoLinearGauge({
@@ -800,6 +809,7 @@ Resolves the promise with the raw SVG document without the Data URI prefix.
800809
`Promise` A promise that will be resolved with a SVG document encoded as a Data URI.
801810

802811
#### Example - Exporting a chart to an SVG document
812+
803813
<div id="gauge"></div>
804814
<script>
805815
$("#gauge").kendoLinearGauge({
@@ -878,13 +888,13 @@ The gauge settings to update.
878888

879889
<div id="gauge"></div>
880890
<script>
881-
$("#gauge").kendoLinearGauge({
882-
pointer: [{
883-
value: 20
884-
}]
885-
});
891+
$("#gauge").kendoLinearGauge({
892+
pointer: [{
893+
value: 20
894+
}]
895+
});
886896

887-
$("#gauge").data("kendoLinearGauge").setOptions({ theme: 'metro' });
897+
$("#gauge").data("kendoLinearGauge").setOptions({ theme: 'metro' });
888898
</script>
889899

890900
### svg

docs/api/javascript/ui/gantt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ If set to `true` the default pop-up editor of the Gantt will render the `planned
21412141
parentId: null,
21422142
title: "Task2",
21432143
plannedStart: new Date("2014/6/17 12:00"),
2144-
plannedEnd: new Date("2014/6/17 16:00")
2144+
plannedEnd: new Date("2014/6/17 16:00"),
21452145
start: new Date("2014/6/17 12:00"),
21462146
end: new Date("2014/6/17 14:00")
21472147
}

src/kendo.dialog.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,15 @@
776776
var that = this;
777777

778778
var zStack = $(KWINDOW).filter(function() {
779-
var dom = $(this);
780-
var object = that._object(dom);
781-
var options = object && object.options;
782-
783-
return options && options.modal && that.options.appendTo == options.appendTo && options.visible && dom.is(VISIBLE);
779+
var modal = that._object($(this));
780+
781+
return modal &&
782+
modal.options &&
783+
modal.options.modal &&
784+
modal.options.visible &&
785+
modal.options.appendTo === that.options.appendTo &&
786+
!modal.containment &&
787+
$(modal.element).is(VISIBLE);
784788
}).sort(function(a, b) {
785789
return +$(a).css("zIndex") - +$(b).css("zIndex");
786790
});

src/kendo.window.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,15 @@
801801
var that = this;
802802

803803
var zStack = $(KWINDOW).filter(function() {
804-
var dom = $(this);
805-
var object = that._object(dom);
806-
var options = object && object.options;
807-
808-
return options && options.modal && options.visible && options.appendTo === that.options.appendTo && dom.is(VISIBLE);
804+
var modal = that._object($(this));
805+
806+
return modal &&
807+
modal.options &&
808+
modal.options.modal &&
809+
modal.options.visible &&
810+
modal.options.appendTo === that.options.appendTo &&
811+
!modal.containment &&
812+
$(modal.element).is(VISIBLE);
809813
}).sort(function(a, b){
810814
return +$(a).css("zIndex") - +$(b).css("zIndex");
811815
});

tests/dialog/api.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,23 @@
183183
assert.isOk(dialog1.wrapper.prev("div").is(".k-overlay"));
184184
});
185185

186+
it("closing dialog removes overlay if previous modal has containment enabled", function() {
187+
$("<div id='container' style='height: 400px; width: 400px; position: absolute;' />").appendTo(Mocha.fixture);
188+
var dialog1 = createWindow({
189+
modal: true,
190+
draggable: {
191+
containment: "#container"
192+
},
193+
animation: false
194+
});
195+
var dialog2 = createDialog({ animation: false });
196+
197+
dialog2.close();
198+
dialog1.close();
199+
200+
assert.equal($(".k-overlay").length, 0);
201+
});
202+
186203
it("closing dialog from close handler", function() {
187204
var dialog = createDialog({
188205
close: function(e) {

tests/window/api.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,26 @@
219219
assert.isOk(dialog.wrapper.prev("div").is(".k-overlay"));
220220
});
221221

222+
it("closing a modal window removes overlay if previous modal has containment enabled", function() {
223+
$("<div id='container' style='height: 400px; width: 400px; position: absolute;' />").appendTo(Mocha.fixture);
224+
var dialog = createWindow({
225+
modal: true,
226+
draggable: {
227+
containment: "#container"
228+
},
229+
animation: false
230+
}),
231+
overlappingDialog = createWindow({
232+
modal: true,
233+
animation: false
234+
});
235+
236+
overlappingDialog.close();
237+
dialog.close();
238+
239+
assert.equal($(".k-overlay").length, 0);
240+
});
241+
222242
it("destroying a modal window removes overlay if other open window has different appendTo", function() {
223243
var dialog = createWindow({
224244
modal: true,

0 commit comments

Comments
 (0)