diff --git a/php-console.js b/php-console.js index f25e2c4..995a43d 100644 --- a/php-console.js +++ b/php-console.js @@ -33,9 +33,13 @@ */ prepareClippyButton = function(e) { var selection = editor.getSession().doc.getTextRange(editor.getSelectionRange()); + if (!selection) { + $('.statusbar .copy').hide(); + return; + } $('#clippy embed').attr('FlashVars', 'text=' + selection); $('#clippy param[name="FlashVars"]').attr('value', 'text=' + selection); - $('.statusbar .copy').html($('.statusbar .copy').html()); + $('.statusbar .copy').html($('.statusbar .copy').html()).show(); }; /** diff --git a/styles.css b/styles.css index b58526d..ba1f2c1 100644 --- a/styles.css +++ b/styles.css @@ -48,6 +48,7 @@ a { .statusbar .copy { margin-left: 50px; + display: none; } #clippy { position: relative;