Skip to content

Commit 820e3dc

Browse files
committed
Sync with Kendo UI Professional
1 parent bd789e9 commit 820e3dc

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

src/kendo.data.odata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ var __meta__ = {
108108
}
109109

110110
if (operator === "isnullorempty") {
111-
filter = kendo.format("{0} {1} null or {0} {1} ''", field, filter);
111+
filter = kendo.format("({0} {1} null or {0} {1} '')", field, filter);
112112
} else if (operator === "isnotnullorempty") {
113-
filter = kendo.format("{0} {1} null and {0} {1} ''", field, filter);
113+
filter = kendo.format("({0} {1} null and {0} {1} '')", field, filter);
114114
} else if (operator === "isnull" || operator === "isnotnull") {
115115
filter = kendo.format("{0} {1} null", field, filter);
116116
} else if (operator === "isempty" || operator === "isnotempty") {

src/kendo.menu.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ var __meta__ = {
540540
closeOnClick: true,
541541
hoverDelay: 100,
542542
scrollable: false,
543-
popupCollision: undefined
543+
popupCollision: null
544544
},
545545

546546
_initData: function() {
@@ -1097,7 +1097,16 @@ var __meta__ = {
10971097
parentHorizontal = root && horizontal,
10981098
directions = parseDirection(direction, root, isRtl),
10991099
effects = options.animation.open.effects,
1100-
openEffects = effects !== undefined ? effects : "slideIn:" + getEffectDirection(direction, root);
1100+
openEffects = effects !== undefined ? effects : "slideIn:" + getEffectDirection(direction, root),
1101+
collision;
1102+
1103+
if (options.popupCollision !== null) {
1104+
collision = options.popupCollision;
1105+
} else if (parentHorizontal) {
1106+
collision = "fit";
1107+
} else {
1108+
collision = "fit flip";
1109+
}
11011110

11021111
if (!popup) {
11031112
popup = div.kendoPopup({
@@ -1111,7 +1120,7 @@ var __meta__ = {
11111120
},
11121121
origin: directions.origin,
11131122
position: directions.position,
1114-
collision: options.popupCollision !== undefined ? options.popupCollision : (parentHorizontal ? "fit" : "fit flip"),
1123+
collision: collision,
11151124
anchor: li,
11161125
appendTo: overflowWrapper || li,
11171126
animation: {

tests/data/odata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236

237237
it("$filter and isnullorempty operator uses eq", function() {
238238
var result = parameterMap({ filter: { filters: [{ field: "Name", operator: "isnullorempty" }] } });
239-
assert.equal(result.$filter, "Name eq null or Name eq ''");
239+
assert.equal(result.$filter, "(Name eq null or Name eq '')");
240240
});
241241

242242

@@ -247,7 +247,7 @@
247247

248248
it("$filter and isnotnullorempty operator uses ne", function() {
249249
var result = parameterMap({ filter: { filters: [{ field: "Name", operator: "isnotnullorempty" }] } });
250-
assert.equal(result.$filter, "Name ne null and Name ne ''");
250+
assert.equal(result.$filter, "(Name ne null and Name ne '')");
251251
});
252252

253253
it("$filter with nested field", function() {

tests/menu/mvvm.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,15 @@ it("binding invisible to false shows the menu", function() {
108108

109109
assert.isOk(menu.wrapper.css("display") != "none", "menu is not invisible");
110110
});
111+
112+
it("the data-popup-collision configuration is parsed correctly", function() {
113+
dom = $('<div data-role="menu" data-popup-collision="flip flip"></div>');
114+
115+
kendo.bind(dom);
116+
117+
var menu = dom.data("kendoMenu");
118+
119+
assert.isOk(menu.options.popupCollision === "flip flip");
120+
});
111121
});
112122
}());

0 commit comments

Comments
 (0)