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