Skip to content

Commit 4d52dfd

Browse files
committed
Sync with Kendo UI Professional
1 parent a5482d1 commit 4d52dfd

File tree

7 files changed

+260
-187
lines changed

7 files changed

+260
-187
lines changed

package-lock.json

Lines changed: 25 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"word-wrap": ">=1.2.4",
7070
"semver": ">=7.5.2",
7171
"semver-regex": ">=3.1.4",
72-
"follow-redirects": ">=1.15.4"
72+
"follow-redirects": ">=1.15.4",
73+
"es5-ext": ">=0.10.63"
7374
},
7475
"scripts": {
7576
"build": "npm ci && npx gulp build",

src/kendo.binder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,12 +1187,16 @@ var __meta__ = {
11871187
Binder.fn.init.call(this, widget.element[0], bindings, options);
11881188

11891189
this.widget = widget;
1190+
this.readonly = this.element.readOnly;
11901191
},
11911192

11921193
refresh: function() {
11931194
if (this.widget.enable) {
11941195
this.widget.enable(this.bindings.enabled.get());
11951196
}
1197+
if (this.readonly && this.widget.readonly) {
1198+
this.widget.readonly(this.readonly);
1199+
}
11961200
}
11971201
}),
11981202

src/kendo.tabstrip.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,15 @@ var __meta__ = {
927927
},
928928

929929
_active: function() {
930-
var item = this.tabGroup.children().filter("." + ACTIVESTATE);
930+
var that = this;
931+
setTimeout(function() {
932+
var item = that.tabGroup.children().filter("." + ACTIVESTATE);
931933

932-
item = item[0] ? item : this._endItem("first");
933-
if (item[0]) {
934-
this._current(item);
935-
}
934+
item = item[0] ? item : that._endItem("first");
935+
if (item[0]) {
936+
that._current(item);
937+
}
938+
}, 100);
936939
},
937940

938941
_animations: function(options) {
@@ -949,6 +952,10 @@ var __meta__ = {
949952
var that = this,
950953
options = that.options;
951954

955+
that.tabGroup
956+
.on(CLICK + NS, ".k-disabled .k-link", false)
957+
.on(CLICK + NS, " > " + NAVIGATABLEITEMS, that._itemClick.bind(that));
958+
952959
that.wrapper.on("focus" + NS, function() { that.tabGroup.trigger("focus"); });
953960

954961
that.tabGroup
@@ -961,10 +968,6 @@ var __meta__ = {
961968
if (options.navigatable) {
962969
that.tabGroup.on("keydown" + NS, that._keyDownProxy);
963970
}
964-
965-
that.tabGroup
966-
.on(CLICK + NS, ".k-disabled .k-link", false)
967-
.on(CLICK + NS, " > " + NAVIGATABLEITEMS, that._itemClick.bind(that));
968971
},
969972

970973
_click: function(item) {
@@ -978,7 +981,7 @@ var __meta__ = {
978981
neighbours = item.parent().children(),
979982
oldFocusedTab = neighbours.filter("." + FOCUSEDSTATE);
980983

981-
if (item.closest(".k-widget")[0] != that.wrapper[0]) {
984+
if (item.closest(".k-tabstrip")[0] != that.wrapper[0]) {
982985
return;
983986
}
984987

@@ -1091,9 +1094,7 @@ var __meta__ = {
10911094
}
10921095

10931096
if (candidate) {
1094-
if (!candidate.hasClass(ACTIVESTATE)) {
1095-
candidate.addClass(FOCUSEDSTATE);
1096-
}
1097+
candidate.addClass(FOCUSEDSTATE);
10971098
}
10981099

10991100
that._focused = candidate;

tests/autocomplete/mvvm.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -351,19 +351,6 @@ it("changing visible to true shows the widget", function() {
351351
assert.isOk(dom.data("kendoAutoComplete").wrapper.css("display") != "none", "Display is not 'none'");
352352
});
353353

354-
355-
it("binding enabled to false disables the widget", function() {
356-
dom = $('<input data-bind="enabled:enabled" data-role="autocomplete"/>');
357-
358-
var observable = kendo.observable({
359-
enabled: false
360-
});
361-
362-
kendo.bind(dom, observable);
363-
364-
assert.isOk(dom.is(":disabled"));
365-
});
366-
367354
it("binding enabled to true enables the widget", function() {
368355
dom = $('<input data-bind="enabled:enabled" disabled="disabled" data-role="autocomplete" />');
369356

tests/mvvm/binding.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,14 @@
12461246
assert.equal(dom[0].hasAttribute("readonly"), false);
12471247
});
12481248

1249+
it("readonly attribute has higher priority that enabled", function() {
1250+
dom = $('<input data-role="textbox" data-bind="enabled: isEnabled" readonly/>');
1251+
kendo.bind(dom, { isEnabled: true });
1252+
1253+
assert.equal(dom[0].readOnly, true);
1254+
assert.equal(dom[0].hasAttribute("readonly"), true);
1255+
});
1256+
12491257
it("bind to parent property with nested kendo.bind", function() {
12501258
var viewModel = kendo.observable({
12511259
foo: {

0 commit comments

Comments
 (0)