Merge pull request #982 from codenift/track_type_fix_hide_null

hides track type in library if null
This commit is contained in:
Kyle Robbertze 2020-03-21 22:26:43 +02:00 committed by GitHub
commit 6ac31f3a15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -94,6 +94,7 @@ class Application_Form_EditAudioMD extends Zend_Form
// Add track type dropdown
$track_type_options = array();
$track_types = Application_Model_Tracktype::getTracktypes();
$track_type_options[""] = _('Select a Type');
foreach ($track_types as $key => $tt) {
$track_type_options[$tt['code']] = $tt['type_name'];
}

View File

@ -767,6 +767,14 @@ var AIRTIME = (function(AIRTIME) {
$(this).contextMenu({x: $(e.target).offset().left, y: $(e.target).offset().top})
}).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')
.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.");
}
});
}).html("<div class='library_track_type_btn'>"+aData.track_type+"</div>");
}).html(type_button);
}
// add audio preview image/button