From 820e3dcaac720805dcf7e10b02123742789444d1 Mon Sep 17 00:00:00 2001 From: kendo-bot Date: Tue, 17 Sep 2024 04:19:08 +0000 Subject: [PATCH] Sync with Kendo UI Professional --- src/kendo.data.odata.js | 4 ++-- src/kendo.menu.js | 15 ++++++++++++--- tests/data/odata.js | 4 ++-- tests/menu/mvvm.js | 10 ++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/kendo.data.odata.js b/src/kendo.data.odata.js index 646d95653fd..6332d71c955 100644 --- a/src/kendo.data.odata.js +++ b/src/kendo.data.odata.js @@ -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") { diff --git a/src/kendo.menu.js b/src/kendo.menu.js index 17f2f681871..639741e29bd 100644 --- a/src/kendo.menu.js +++ b/src/kendo.menu.js @@ -540,7 +540,7 @@ var __meta__ = { closeOnClick: true, hoverDelay: 100, scrollable: false, - popupCollision: undefined + popupCollision: null }, _initData: function() { @@ -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({ @@ -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: { diff --git a/tests/data/odata.js b/tests/data/odata.js index 783a6b2c358..caf889a3698 100644 --- a/tests/data/odata.js +++ b/tests/data/odata.js @@ -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 '')"); }); @@ -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() { diff --git a/tests/menu/mvvm.js b/tests/menu/mvvm.js index bd36785df4d..32fefe1500c 100644 --- a/tests/menu/mvvm.js +++ b/tests/menu/mvvm.js @@ -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 = $('
'); + + kendo.bind(dom); + + var menu = dom.data("kendoMenu"); + + assert.isOk(menu.options.popupCollision === "flip flip"); +}); }); }());