CC-3174 : showbuilder

making sure an item is not added outside of a show.
This commit is contained in:
Naomi Aro 2012-02-28 16:57:53 +01:00
parent 9b639a9b6d
commit b5f510de85
2 changed files with 28 additions and 23 deletions

View file

@ -535,8 +535,17 @@ $(document).ready(function() {
};
fnUpdate = function(event, ui) {
var prev = ui.item.prev();
//can't add items outside of shows.
if (prev.hasClass("sb-footer")) {
alert("Cannot add an item outside a show.");
ui.item.remove();
return;
}
aItemData = [];
oPrevData = ui.item.prev().data("aData");
oPrevData = prev.data("aData");
//item was dragged in
if (origTrs !== undefined) {
@ -561,10 +570,7 @@ $(document).ready(function() {
forcePlaceholderSize: true,
items: 'tr:not(:first, :last, .sb-header, .sb-footer, .sb-not-allowed)',
receive: fnReceive,
update: fnUpdate,
start: function(event, ui) {
//ui.placeholder.html("PLACE HOLDER");
}
update: fnUpdate
};
}());