CC-4455: "Add to current smart block" context menu action should be disabled for dynamic smart blocks
-disabled this button in the library toolbar if dynamic blocks are open
This commit is contained in:
parent
e262d48eec
commit
a1a7396ec9
|
@ -8,10 +8,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
mod = AIRTIME.library;
|
||||
|
||||
mod.checkAddButton = function() {
|
||||
var selected = mod.getChosenItemsLength(), sortable = $('#spl_sortable'), check = false;
|
||||
|
||||
// make sure audioclips are selected and a playlist is currently open.
|
||||
if (selected !== 0 && sortable.length !== 0) {
|
||||
var selected = mod.getChosenItemsLength(),
|
||||
sortable = $('#spl_sortable:visible'),
|
||||
check = false,
|
||||
blockType = $('input[name=sp_type]:checked', '#smart-block-form').val();
|
||||
|
||||
// make sure audioclips are selected and a playlist or static block is currently open.
|
||||
// static blocks have value of 0
|
||||
// dynamic blocks have value of 1
|
||||
if (selected !== 0 && (sortable.length !== 0 || blockType === "0")) {
|
||||
check = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,8 @@ function setSmartBlockEvents() {
|
|||
|
||||
/********** CHANGE PLAYLIST TYPE **********/
|
||||
form.find('dd[id="sp_type-element"]').live("change", function(){
|
||||
setupUI();
|
||||
setupUI();
|
||||
AIRTIME.library.checkAddButton();
|
||||
});
|
||||
|
||||
/********** CRITERIA CHANGE **********/
|
||||
|
|
Loading…
Reference in New Issue