From af8f7e2842e6037f16ec8b3b68af1254a0de2192 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 18 Jun 2012 13:06:24 +0200 Subject: [PATCH] cleanup, fix double close button --- static/js/pandora/uploadDialog.js | 32 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/static/js/pandora/uploadDialog.js b/static/js/pandora/uploadDialog.js index 97f525559..9873c2210 100644 --- a/static/js/pandora/uploadDialog.js +++ b/static/js/pandora/uploadDialog.js @@ -3,11 +3,11 @@ pandora.ui.uploadDialog = function(data) { - var actionButton, - cancelled = false, - closeButton, + var cancelled = false, file, selectFile, + $actionButton, + $closeButton, $content = Ox.Element().css({margin: '16px'}), $info = $('
').css({padding: '4px'}) .html('Please select the video file you want to upload.'), @@ -15,7 +15,7 @@ pandora.ui.uploadDialog = function(data) { $status = $('
').css({padding: '4px', paddingTop: '8px'}), that = Ox.Dialog({ buttons: [ - closeButton = Ox.Button({ + $closeButton = Ox.Button({ id: 'close', title: 'Close' }).bindEvent({ @@ -23,26 +23,24 @@ pandora.ui.uploadDialog = function(data) { that.triggerEvent('close'); } }), - actionButton = Ox.Button({ + $actionButton = Ox.Button({ id: 'action', title: 'Select Video' }).bindEvent({ click: function() { - if (actionButton.options('title') == 'Select Video') { + if ($actionButton.options('title') == 'Select Video') { if (selectVideo()) { - actionButton.options('title', 'Upload'); + $actionButton.options('title', 'Upload'); } - } else if (actionButton.options('title') == 'Close') { - that.close(); - } else if (actionButton.options('title') == 'Cancel') { + } else if ($actionButton.options('title') == 'Cancel') { cancelled = true; pandora.firefogg && pandora.firefogg.cancel(); pandora.$ui.upload && pandora.$ui.upload.abort(); - actionButton.options('title', 'Select Video'); - closeButton.show(); + $actionButton.options('title', 'Select Video'); + $closeButton.show(); } else { - actionButton.options('title', 'Cancel'); - closeButton.hide(); + $actionButton.options('title', 'Cancel'); + $closeButton.hide(); encode(); } } @@ -97,14 +95,14 @@ pandora.ui.uploadDialog = function(data) { }) .appendTo($content); */ - actionButton.options({title: 'Close'}); - $info.css({paddingTop: '16px', paddingBottom: '16px'}).html( + $info.html( 'Currently, video upload is only supported in ' - + 'Firefox with ' + + 'Firefox, with ' + 'Firefogg installed.

' + 'Alternatively, you can use ' + 'pandora_client.' ); + $actionButton.hide(); } $content.append($info); $content.append($status);