Fix exception on Internet Explorer when adding first transcript language
Internet Explorer throws an "Invalid argument" exception when uses an empty string as the parameter in ```namedItem``` method. Change empty string into null value can maintain browser consistency.
This commit is contained in:
@@ -47,6 +47,13 @@ function($, _, AbstractEditor, FileUpload, UploadDialog) {
|
||||
var dropdown = $(element).clone();
|
||||
|
||||
_.each(values, function(value, key) {
|
||||
// Note: IE may raise an exception if key is an empty string,
|
||||
// while other browsers return null as excepted. So coerce it
|
||||
// into null for browser consistency.
|
||||
if (key === "") {
|
||||
key = null;
|
||||
}
|
||||
|
||||
var option = dropdown[0].options.namedItem(key);
|
||||
|
||||
if (option) {
|
||||
|
||||
Reference in New Issue
Block a user