Fix bug. Add validation to HTML5 sources field.

This commit is contained in:
Valera Rozuvan
2013-10-23 11:52:22 +03:00
parent aecc20af6b
commit ba5f337fdb
2 changed files with 12 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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;