CC-4206: Smart Playlist: Edit cue in/out setting will lost all contents

-fixed event bubbling
This commit is contained in:
denise 2012-08-13 12:46:17 -04:00
parent 5e1d8eabb3
commit 0203c3f0c5
1 changed files with 37 additions and 31 deletions

View File

@ -61,11 +61,8 @@ var AIRTIME = (function(AIRTIME){
.hide();
}
function changeCueIn(event) {
event.stopPropagation();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
function changeCueIn(span) {
var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueIn = $.trim(span.text()),
li = span.parents("li"),
@ -100,11 +97,8 @@ var AIRTIME = (function(AIRTIME){
});
}
function changeCueOut(event) {
event.stopPropagation();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
function changeCueOut(span) {
var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueOut = $.trim(span.text()),
li = span.parents("li"),
@ -140,7 +134,7 @@ var AIRTIME = (function(AIRTIME){
}
function changeFadeIn(event) {
event.stopPropagation();
event.preventDefault();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
@ -407,13 +401,25 @@ var AIRTIME = (function(AIRTIME){
//sets events dynamically for the cue editor.
function setCueEvents() {
$pl.delegate(".spl_cue_in span",
{"focusout": changeCueIn,
"keydown": submitOnEnter});
$('.spl_cue_in span').blur(function(e){
e.stopPropagation();
changeCueIn($(this));
});
$pl.delegate(".spl_cue_out span",
{"focusout": changeCueOut,
"keydown": submitOnEnter});
$('.spl_cue_in span').keydown(function(e){
e.stopPropagation();
submitOnEnter(e);
});
$('.spl_cue_out span').blur(function(e){
e.stopPropagation();
changeCueOut($(this));
});
$('.spl_cue_out span').keydown(function(e){
e.stopPropagation();
submitOnEnter(e);
});
}
//sets events dynamically for the fade editor.