Hid type button in library if null, added "select a type" in track edit
This commit is contained in:
parent
5691c69102
commit
707e4f447a
|
@ -94,6 +94,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
// Add track type dropdown
|
// Add track type dropdown
|
||||||
$track_type_options = array();
|
$track_type_options = array();
|
||||||
$track_types = Application_Model_Tracktype::getTracktypes();
|
$track_types = Application_Model_Tracktype::getTracktypes();
|
||||||
|
$track_type_options[""] = _('Select a Type');
|
||||||
foreach ($track_types as $key => $tt) {
|
foreach ($track_types as $key => $tt) {
|
||||||
$track_type_options[$tt['code']] = $tt['type_name'];
|
$track_type_options[$tt['code']] = $tt['type_name'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -767,6 +767,14 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
$(this).contextMenu({x: $(e.target).offset().left, y: $(e.target).offset().top})
|
$(this).contextMenu({x: $(e.target).offset().left, y: $(e.target).offset().top})
|
||||||
}).html("<div class='library_actions_btn'>...</div>");
|
}).html("<div class='library_actions_btn'>...</div>");
|
||||||
|
|
||||||
|
if (aData.track_type == null || aData.track_type == undefined || aData.track_type == 0) {
|
||||||
|
var has_type = false;
|
||||||
|
var type_button = "";
|
||||||
|
} else {
|
||||||
|
var has_type = true;
|
||||||
|
var type_button = "<div class='library_track_type_btn'>"+aData.track_type+"</div>";
|
||||||
|
}
|
||||||
|
|
||||||
$(nRow).find('td.library_track_type')
|
$(nRow).find('td.library_track_type')
|
||||||
.on('click', function (e) {
|
.on('click', function (e) {
|
||||||
|
|
||||||
|
@ -814,12 +822,12 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(type_enabled == false){
|
if(type_enabled == false && has_type == true){
|
||||||
alert("This type is disabled.");
|
alert("This type is disabled.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}).html("<div class='library_track_type_btn'>"+aData.track_type+"</div>");
|
}).html(type_button);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add audio preview image/button
|
// add audio preview image/button
|
||||||
|
|
Loading…
Reference in New Issue