equal
deleted
inserted
replaced
507 } |
507 } |
508 }); |
508 }); |
509 $("#segment-description").on("keyup change input paste", function() { |
509 $("#segment-description").on("keyup change input paste", function() { |
510 if (currentMedia && currentSegment) { |
510 if (currentMedia && currentSegment) { |
511 currentSegment.description = $(this).val(); |
511 currentSegment.description = $(this).val(); |
|
512 updateSegmentUI(); |
512 mashup.trigger("change"); |
513 mashup.trigger("change"); |
513 } |
514 } |
514 }); |
515 }); |
515 $("#segment-form").submit(function() { |
516 $("#segment-form").submit(function() { |
|
517 currentSegment.title = $("#segment-title").val(); |
|
518 currentSegment.description = $("#segment-description").val(); |
|
519 currentSegment.keywords = $("#segment-tags").tagit("assignedTags"); |
|
520 updateSegmentUI(); |
516 if (addMode) { |
521 if (addMode) { |
517 mashup.addAnnotation(currentSegment); |
522 mashup.addAnnotation(currentSegment); |
518 currentSegment = undefined; |
523 currentSegment = undefined; |
519 setMedia(currentMedia); |
524 setMedia(currentMedia); |
520 } else { |
525 } else { |
537 * are triggered before the data are updated */ |
542 * are triggered before the data are updated */ |
538 function updateSegmentTags() { |
543 function updateSegmentTags() { |
539 window.setTimeout(function() { |
544 window.setTimeout(function() { |
540 if (currentMedia && currentSegment) { |
545 if (currentMedia && currentSegment) { |
541 currentSegment.keywords = $("#segment-tags").tagit("assignedTags"); |
546 currentSegment.keywords = $("#segment-tags").tagit("assignedTags"); |
|
547 updateSegmentUI(); |
|
548 mashup.trigger("change"); |
542 } |
549 } |
543 }, 0); |
550 }, 0); |
544 } |
551 } |
545 |
552 |
546 /* Click on media items */ |
553 /* Click on media items */ |