select subtitles layer by default if selecting an srt file

This commit is contained in:
j 2019-11-13 12:41:38 +00:00
parent 69083d1521
commit dd7e1d0ba0

View file

@ -68,7 +68,14 @@ pandora.ui.importAnnotationsDialog = function(options) {
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
$status.empty(); $status.empty();
data.value.length && $formatSelect.options({value: Ox.last(data.value[0].name.split('.'))}); if (data.value.length) {
var format = Ox.last(data.value[0].name.split('.'));
$formatSelect.options({value: format});
var subtitlesLayer = pandora.getSubtitlesLayer()
if (subtitlesLayer && format == 'srt' && Ox.getObjectById(layers, subtitlesLayer)) {
$layerSelect.options({value: subtitlesLayer})
}
}
that[ that[
data.value.length ? 'enableButton' : 'disableButton' data.value.length ? 'enableButton' : 'disableButton'
]('import'); ]('import');