Commit 551301a7 by louyihua

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.
parent b2656bb2
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment