dont select layer by default

This commit is contained in:
j 2013-01-12 06:55:20 +00:00
parent ffd256ca93
commit eb0c1d13ba

View file

@ -8,7 +8,7 @@ pandora.ui.importAnnotations = function(data) {
layers = pandora.site.layers.filter(function(layer) { layers = pandora.site.layers.filter(function(layer) {
return layer.canAddAnnotations[pandora.user.level]; return layer.canAddAnnotations[pandora.user.level];
}), }),
layer = layers[0].id, layer,
width = 384, width = 384,
srt = [], srt = [],
total = 0, total = 0,
@ -109,12 +109,16 @@ pandora.ui.importAnnotations = function(data) {
}).html('Import annotations from .srt file:')); }).html('Import annotations from .srt file:'));
selectLayer = Ox.Select({ selectLayer = Ox.Select({
items: layers, items: layers,
value: layer, title: 'select...',
label: 'Layer' label: 'Layer'
}) })
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
selectLayer.options({
title: null
});
layer = data.value; layer = data.value;
total && layer && importButton.options({disabled: false});
} }
}) })
.appendTo(content); .appendTo(content);
@ -134,7 +138,7 @@ pandora.ui.importAnnotations = function(data) {
reader.onloadend = function(event) { reader.onloadend = function(event) {
srt = parseSRT(this.result); srt = parseSRT(this.result);
total = srt.length; total = srt.length;
total && importButton.options({disabled: false}); total && layer && importButton.options({disabled: false});
$status.html( $status.html(
'File contains ' + total + ' annotation' 'File contains ' + total + ' annotation'
+ (total == 1 ? '' : 's') + '.' + (total == 1 ? '' : 's') + '.'