From eb0c1d13baeca2826d10850e7e5e4b62a8af2e74 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 12 Jan 2013 06:55:20 +0000 Subject: [PATCH] dont select layer by default --- static/js/pandora/importAnnotations.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/importAnnotations.js b/static/js/pandora/importAnnotations.js index 5d311bd6e..17b1b5738 100644 --- a/static/js/pandora/importAnnotations.js +++ b/static/js/pandora/importAnnotations.js @@ -8,7 +8,7 @@ pandora.ui.importAnnotations = function(data) { layers = pandora.site.layers.filter(function(layer) { return layer.canAddAnnotations[pandora.user.level]; }), - layer = layers[0].id, + layer, width = 384, srt = [], total = 0, @@ -109,12 +109,16 @@ pandora.ui.importAnnotations = function(data) { }).html('Import annotations from .srt file:')); selectLayer = Ox.Select({ items: layers, - value: layer, + title: 'select...', label: 'Layer' }) .bindEvent({ change: function(data) { + selectLayer.options({ + title: null + }); layer = data.value; + total && layer && importButton.options({disabled: false}); } }) .appendTo(content); @@ -134,7 +138,7 @@ pandora.ui.importAnnotations = function(data) { reader.onloadend = function(event) { srt = parseSRT(this.result); total = srt.length; - total && importButton.options({disabled: false}); + total && layer && importButton.options({disabled: false}); $status.html( 'File contains ' + total + ' annotation' + (total == 1 ? '' : 's') + '.'