Skip to content

Commit f8fb43b

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 5a9d0e6 commit f8fb43b

File tree

8 files changed

+55
-10
lines changed

8 files changed

+55
-10
lines changed

src/kendo.angular.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,8 @@ var __meta__ = { // jshint ignore:line
789789
TreeView : "ul",
790790
Menu : "ul",
791791
ContextMenu : "ul",
792-
ActionSheet : "ul"
792+
ActionSheet : "ul",
793+
Switch : "input"
793794
};
794795

795796
var SKIP_SHORTCUTS = [

src/kendo.combobox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ var __meta__ = { // jshint ignore:line
780780
that._placeholder(true);
781781
}
782782

783-
that._old = that._accessor();
783+
that._old = that._valueBeforeCascade = that._accessor();
784784
that._oldIndex = that.selectedIndex;
785785

786786
that._prev = that.input.val();

src/kendo.dropdownlist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ var __meta__ = { // jshint ignore:line
424424
}
425425

426426
listView.value(value).done(function() {
427-
that._old = that._accessor();
427+
that._old = that._valueBeforeCascade = that._accessor();
428428
that._oldIndex = that.selectedIndex;
429429
});
430430
},

src/kendo.list.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,8 +1795,8 @@ var __meta__ = { // jshint ignore:line
17951795
endY = tapPosition(e);
17961796

17971797
if (Math.abs(endY - startY) < 10) {
1798-
e.preventDefault();
1799-
that.trigger("click", { item: $(e.target.closest(ITEMSELECTOR)) });
1798+
that._touchTriggered = true;
1799+
that._triggerClick($(e.target).closest(ITEMSELECTOR).get(0));
18001800
}
18011801
});
18021802
},
@@ -2075,10 +2075,20 @@ var __meta__ = { // jshint ignore:line
20752075
},
20762076

20772077
_click: function(e) {
2078+
if (this._touchTriggered)
2079+
{
2080+
this._touchTriggered = false;
2081+
return;
2082+
}
2083+
20782084
if (!e.isDefaultPrevented()) {
2079-
if (!this.trigger("click", { item: $(e.currentTarget) })) {
2080-
this.select(e.currentTarget);
2081-
}
2085+
this._triggerClick(e.currentTarget);
2086+
}
2087+
},
2088+
2089+
_triggerClick: function (item) {
2090+
if (!this.trigger("click", { item: $(item) })) {
2091+
this.select(item);
20822092
}
20832093
},
20842094

src/kendo.multiselect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ var __meta__ = { // jshint ignore:line
604604
}
605605

606606
listView.value(value);
607-
that._old = listView.value(); //get a new array reference
607+
that._old = that._valueBeforeCascade = listView.value(); //get a new array reference
608608

609609
if (!clearFilters) {
610610
that._fetchData();

tests/combobox/api.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@
108108
assert.equal(combobox._old, "2");
109109
});
110110

111+
it("change is not triggered on blur after value()", function() {
112+
var combobox = new ComboBox(input, {
113+
change: function () {
114+
assert.isOk(false);
115+
}
116+
});
117+
combobox.value("2");
118+
119+
combobox._blur();
120+
});
121+
111122
it("value('') clear selection", function() {
112123
var combobox = new ComboBox(input, {
113124
dataTextField: "text",

tests/dropdownlist/api.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
assert.equal(dropdownlist.text(), 2);
4343
});
4444

45+
it("change is not triggered on blur after value()", function() {
46+
dropdownlist = createDropDownList({
47+
change: function () {
48+
assert.isOk(false);
49+
}
50+
});
51+
dropdownlist.value("2");
52+
53+
dropdownlist._blur();
54+
});
55+
4556
it("value method should select optionLabel if it does not exist", function() {
4657
dropdownlist = new DropDownList(input, {
4758
optionLabel: "select",
@@ -1019,7 +1030,7 @@
10191030
done();
10201031
}
10211032
});
1022-
1033+
10231034
dropdownlist.value("item2");
10241035
});
10251036

tests/multiselect/api.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@
296296
});
297297
});
298298

299+
it("change is not triggered on blur after value()", function() {
300+
popuplateSelect();
301+
var multiselect = new MultiSelect(select, {
302+
change: function () {
303+
assert.isOk(false);
304+
}
305+
});
306+
307+
multiselect.value(["0", "1"]);
308+
multiselect._blur();
309+
});
310+
299311
it("MultiSelect opens popup", function() {
300312
popuplateSelect();
301313
var multiselect = new MultiSelect(select);

0 commit comments

Comments
 (0)