Commit ba5f337f by Valera Rozuvan

Fix bug. Add validation to HTML5 sources field.

parent aecc20af
......@@ -110,11 +110,19 @@ function($, Backbone, _, Utils, MetadataView, MetadataCollection) {
// Get values from `Advanced` tab fields (`html5_sources`,
// `youtube_id_1_0`) that should be synchronized.
values.html5Sources = getField(metadataCollection, 'html5_sources')
.getDisplayValue();
html5Sources = getField(metadataCollection, 'html5_sources')
                                    .getDisplayValue();
            values.youtube = getField(metadataCollection, 'youtube_id_1_0')
                                    .getDisplayValue();
            values.html5Sources = _.filter(html5Sources, function (value) {
                var link = Utils.parseLink(value),
mode = link && link.mode;
                return mode === 'html5' && mode;
            });
values.youtube = getField(metadataCollection, 'youtube_id_1_0')
.getDisplayValue();
// The length of youtube video_id should be 11 characters.
if (values.youtube.length === 11) {
......
......@@ -317,8 +317,6 @@ define(["jquery", "underscore", "jquery.ajaxQueue"], function($, _) {
return function (action, component_id, videoList, extraParams) {
var params, data;
console.log('[_command]: arguments = ', arguments);
if (extraParams) {
if ($.isPlainObject(extraParams)) {
params = extraParams;
......
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