Skip to content

Commit 714f636

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 5d53bc1 commit 714f636

File tree

5 files changed

+37
-45
lines changed

5 files changed

+37
-45
lines changed

docs-aspnet/html-helpers/editors/upload/chunk-upload.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ To enable the chunk upload:
3737
1. Implement the server-side logic (that is, the `ChunkSave` action is assigned) which processes the file chunks and merges them into file:
3838
3939
```
40+
public IWebHostingEnvironment WebHostEnvironment { get; set; }
41+
42+
public UploadController(IWebHostEnvironment webHostEnvironment)
43+
{
44+
WebHostEnvironment = webHostEnvironment;
45+
}
46+
4047
public class ChunkMetaData
4148
{
4249
public string UploadUid { get; set; }
@@ -94,7 +101,7 @@ To enable the chunk upload:
94101
{
95102
foreach (var file in files)
96103
{
97-
path = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", chunkData.FileName);
104+
path = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", chunkData.FileName);
98105
99106
// AppendToFile(path, file);
100107
}
@@ -123,7 +130,7 @@ To enable the chunk upload:
123130
// Some browsers send file names with full path.
124131
// The demo is interested only in the file name.
125132
var fileName = Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
126-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
133+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
127134
128135
file.SaveAs(physicalPath);
129136
}

docs-aspnet/html-helpers/editors/upload/modes-of-operation.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ An Upload in the synchronous mode behaves like a regular file input—the se
2929
</form>
3030
```
3131
```Controller
32-
public IHostingEnvironment HostingEnvironment { get; set; }
32+
public IWebHostEnvironment WebHostEnvironment { get; set; }
3333
34-
public UploadController(IHostingEnvironment hostingEnvironment)
34+
public UploadController(IWebHostEnvironment webHostEnvironment)
3535
{
36-
HostingEnvironment = hostingEnvironment;
36+
WebHostEnvironment = webHostEnvironment;
3737
}
3838
3939
public ActionResult Submit(IEnumerable<IFormFile> files)
@@ -48,9 +48,8 @@ public ActionResult Submit(IEnumerable<IFormFile> files)
4848
// Some browsers send file names with full path.
4949
// The demo is interested only in the file name.
5050
var fileName = Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
51-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
51+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
5252
53-
// The files are not actually saved in this demo.
5453
using (var fileStream = new FileStream(physicalPath, FileMode.Create))
5554
{
5655
await file.CopyToAsync(fileStream);
@@ -77,11 +76,11 @@ An Upload in the asynchronous mode requires dedicated server handlers to store a
7776
)
7877
```
7978
```Controller
80-
public IHostingEnvironment HostingEnvironment { get; set; }
79+
public IWebHostingEnvironment WebHostEnvironment { get; set; }
8180
82-
public UploadController(IHostingEnvironment hostingEnvironment)
81+
public UploadController(IWebHostEnvironment webHostEnvironment)
8382
{
84-
HostingEnvironment = hostingEnvironment;
83+
WebHostEnvironment = webHostEnvironment;
8584
}
8685
8786
public async Task<ActionResult> SaveAsync(IEnumerable<IFormFile> files)
@@ -96,9 +95,8 @@ public async Task<ActionResult> SaveAsync(IEnumerable<IFormFile> files)
9695
// Some browsers send file names with full path.
9796
// We are only interested in the file name.
9897
var fileName = Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
99-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
98+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
10099
101-
// The files are not actually saved in this demo.
102100
using (var fileStream = new FileStream(physicalPath, FileMode.Create))
103101
{
104102
await file.CopyToAsync(fileStream);
@@ -119,14 +117,13 @@ public ActionResult Remove(string[] fileNames)
119117
foreach (var fullName in fileNames)
120118
{
121119
var fileName = Path.GetFileName(fullName);
122-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
120+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
123121
124122
// TODO: Verify user permissions.
125123
126124
if (System.IO.File.Exists(physicalPath))
127125
{
128-
// The files are not actually removed in this demo.
129-
// System.IO.File.Delete(physicalPath);
126+
System.IO.File.Delete(physicalPath);
130127
}
131128
}
132129
}

docs-aspnet/html-helpers/editors/upload/overview.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ The following example demonstrates how to define the Upload widget by using the
3030
)
3131
```
3232
```Controller
33-
public IHostingEnvironment HostingEnvironment { get; set; }
33+
public IWebHostEnvironment WebHostEnvironment { get; set; }
3434
35-
public UploadController(IHostingEnvironment hostingEnvironment)
35+
public UploadController(IWebHostEnvironment webHostEnvironment)
3636
{
37-
HostingEnvironment = hostingEnvironment;
37+
WebHostEnvironment = webHostEnvironment;
3838
}
3939
4040
public async Task<ActionResult> Save(IEnumerable<IFormFile> files)
@@ -49,9 +49,8 @@ public async Task<ActionResult> Save(IEnumerable<IFormFile> files)
4949
// Some browsers send file names with full path.
5050
// The sample is interested only in the file name.
5151
var fileName = Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
52-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
52+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
5353
54-
// The files are not actually saved in this demo.
5554
using (var fileStream = new FileStream(physicalPath, FileMode.Create))
5655
{
5756
await file.CopyToAsync(fileStream);
@@ -72,14 +71,13 @@ public ActionResult Remove(string[] fileNames)
7271
foreach (var fullName in fileNames)
7372
{
7473
var fileName = Path.GetFileName(fullName);
75-
var physicalPath = Path.Combine(HostingEnvironment.WebRootPath, "App_Data", fileName);
74+
var physicalPath = Path.Combine(WebHostEnvironment.WebRootPath, "App_Data", fileName);
7675
7776
// TODO: Verify user permissions.
7877
7978
if (System.IO.File.Exists(physicalPath))
8079
{
81-
// The files are not actually removed in this demo.
82-
// System. IO.File.Delete(physicalPath);
80+
System. IO.File.Delete(physicalPath);
8381
}
8482
}
8583
}

src/kendo.multiselect.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,6 @@ var __meta__ = { // jshint ignore:line
13121312

13131313
that._setOption(getter(addedItem.dataItem), true);
13141314
}
1315-
1316-
that._updateTagListAria();
13171315
} else {
13181316
if (!that._maxTotal || that._maxTotal < total) {
13191317
that._maxTotal = total;
@@ -1350,15 +1348,6 @@ var __meta__ = { // jshint ignore:line
13501348
currentTotal: total
13511349
}));
13521350
}
1353-
1354-
that._updateTagListAria();
1355-
},
1356-
1357-
_updateTagListAria: function () {
1358-
var that = this;
1359-
var tagList = that.tagList;
1360-
1361-
tagList.attr("role", tagList.children().length ? "listbox" : "presentation");
13621351
},
13631352

13641353
_select: function(candidate) {
@@ -1472,7 +1461,7 @@ var __meta__ = { // jshint ignore:line
14721461
"role": "textbox",
14731462
"title": element[0].title,
14741463
"aria-expanded": false,
1475-
"aria-haspopup": "true",
1464+
"aria-haspopup": "listbox",
14761465
"aria-autocomplete": "list"
14771466
});
14781467
},
@@ -1507,7 +1496,7 @@ var __meta__ = { // jshint ignore:line
15071496
that.tagTextTemplate = tagTemplate = tagTemplate ? kendo.template(tagTemplate) : defaultTemplate;
15081497

15091498
that.tagTemplate = function(data) {
1510-
return '<li role="option" aria-selected="true" class="k-button" unselectable="on"><span unselectable="on">' +
1499+
return '<li aria-selected="true" class="k-button" unselectable="on"><span unselectable="on">' +
15111500
tagTemplate(data) + '</span>' +
15121501
'<span aria-hidden="true" unselectable="on" aria-label="' +
15131502
(isMultiple ? ('delete" title="' + that.options.messages.deleteTag + '" aria-label="' + that.options.messages.deleteTag) : 'open') +
@@ -1551,7 +1540,7 @@ var __meta__ = { // jshint ignore:line
15511540
wrapper[0].style.cssText = element[0].style.cssText;
15521541
wrapper[0].title = element[0].title;
15531542

1554-
$('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(element);
1543+
$('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" role="listbox"/>').insertBefore(element);
15551544
}
15561545

15571546
that.wrapper = wrapper.addClass(element[0].className).removeClass('input-validation-error').css("display", "");

tests/multiselect/aria.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,16 @@
197197
label.remove();
198198
});
199199

200-
it("MultiSelect adds aria-haspopup that takes value equal to the role", function() {
200+
it("MultiSelect adds aria-haspopup that takes value equal to the role of the list", function() {
201+
var multiselect = new MultiSelect(input.attr("id", "test"));
202+
203+
assert.equal(multiselect.input.attr("aria-haspopup"), multiselect.popup.element.find(".k-list").attr("role"));
204+
});
205+
206+
it("MultiSelect input has textbox role", function() {
201207
var multiselect = new MultiSelect(input.attr("id", "test"));
202208

203209
assert.equal(multiselect.input.attr("role"), "textbox");
204-
assert.equal(multiselect.input.attr("aria-haspopup"), "true");
205210
});
206211

207212
it("MultiSelect adds aria-autocomplete", function() {
@@ -254,17 +259,13 @@
254259
assert.isOk(!tag.attr("aria-hidden"));
255260
});
256261

257-
it("MultiSelect toggles listbox role according to selected items", function() {
262+
it("MultiSelect does not assign role to its TagList", function() {
258263
var multiselect = new MultiSelect(input, {
259264
dataSource: ["item1", "item2"],
260265
value: "item1"
261266
});
262267

263-
assert.isOk(multiselect.tagList.attr("role") === "listbox");
264-
265-
multiselect.value([]);
266-
267-
assert.isOk(multiselect.tagList.attr("role") === "presentation");
268+
assert.equal(multiselect.tagList.attr("role"), undefined);
268269
});
269270
});
270271
}());

0 commit comments

Comments
 (0)