From 03fed5a243300d70849aff696838ae5ef73754aa Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 1 Oct 2009 23:44:52 -0400 Subject: [PATCH] fix js stuff --- js/edit-transcripts.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/edit-transcripts.js b/js/edit-transcripts.js index 89df6e8..5ecdbe0 100644 --- a/js/edit-transcripts.js +++ b/js/edit-transcripts.js @@ -23,6 +23,8 @@ WhatDidTheySay.setup_transcript_editor = function(container) { switch_transcripts(); + language_selector.switch_transcripts = switch_transcripts; + language_selector.observe('change', switch_transcripts); get_transcript = function() { return container.select('textarea[name*=[' + $F(language_selector) + ']]').pop(); }; @@ -164,7 +166,7 @@ WhatDidTheySay.setup_transcript_action_buttons = function(container, approved_ed [ [ 'approve', function(e) { - + Event.stop(e); var lang = container.select("input[name*=[language]]").shift(); var post_id = container.select("input[name*=[post_id]]").shift(); var key = container.select("input[name*=[key]]").shift(); @@ -200,12 +202,12 @@ WhatDidTheySay.setup_transcript_action_buttons = function(container, approved_ed var language_selector = approved_editor_container.select('select').pop(); if (language_selector) { - language_selector.selectedIndex = language_selector.options.length - language_selector.selectedIndex; var i,il; for (i = 0, il = language_selector.options.length; i < il; ++i) { if (language_selector.options[i].value == lang) { language_selector.selectedIndex = i; - switch_transcript(); + language_selector.switch_transcripts(); + break; } }