Skip to content

Commit

Permalink
Sync with Kendo UI Professional
Browse files Browse the repository at this point in the history
  • Loading branch information
kendo-bot committed Sep 17, 2024
1 parent bd789e9 commit 820e3dc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/kendo.data.odata.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ var __meta__ = {
}

if (operator === "isnullorempty") {
filter = kendo.format("{0} {1} null or {0} {1} ''", field, filter);
filter = kendo.format("({0} {1} null or {0} {1} '')", field, filter);
} else if (operator === "isnotnullorempty") {
filter = kendo.format("{0} {1} null and {0} {1} ''", field, filter);
filter = kendo.format("({0} {1} null and {0} {1} '')", field, filter);
} else if (operator === "isnull" || operator === "isnotnull") {
filter = kendo.format("{0} {1} null", field, filter);
} else if (operator === "isempty" || operator === "isnotempty") {
Expand Down
15 changes: 12 additions & 3 deletions src/kendo.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ var __meta__ = {
closeOnClick: true,
hoverDelay: 100,
scrollable: false,
popupCollision: undefined
popupCollision: null
},

_initData: function() {
Expand Down Expand Up @@ -1097,7 +1097,16 @@ var __meta__ = {
parentHorizontal = root && horizontal,
directions = parseDirection(direction, root, isRtl),
effects = options.animation.open.effects,
openEffects = effects !== undefined ? effects : "slideIn:" + getEffectDirection(direction, root);
openEffects = effects !== undefined ? effects : "slideIn:" + getEffectDirection(direction, root),
collision;

if (options.popupCollision !== null) {
collision = options.popupCollision;
} else if (parentHorizontal) {
collision = "fit";
} else {
collision = "fit flip";
}

if (!popup) {
popup = div.kendoPopup({
Expand All @@ -1111,7 +1120,7 @@ var __meta__ = {
},
origin: directions.origin,
position: directions.position,
collision: options.popupCollision !== undefined ? options.popupCollision : (parentHorizontal ? "fit" : "fit flip"),
collision: collision,
anchor: li,
appendTo: overflowWrapper || li,
animation: {
Expand Down
4 changes: 2 additions & 2 deletions tests/data/odata.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@

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


Expand All @@ -247,7 +247,7 @@

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

it("$filter with nested field", function() {
Expand Down
10 changes: 10 additions & 0 deletions tests/menu/mvvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,15 @@ it("binding invisible to false shows the menu", function() {

assert.isOk(menu.wrapper.css("display") != "none", "menu is not invisible");
});

it("the data-popup-collision configuration is parsed correctly", function() {
dom = $('<div data-role="menu" data-popup-collision="flip flip"></div>');

kendo.bind(dom);

var menu = dom.data("kendoMenu");

assert.isOk(menu.options.popupCollision === "flip flip");
});
});
}());

0 comments on commit 820e3dc

Please sign in to comment.