Permalink
Browse files

Only enable copy icon when there is actually a selection

  • Loading branch information...
1 parent d9aca6b commit 5d168aa4d8512b16aa40716040aeba1fc8a69984 @Seldaek committed Jan 15, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −1 php-console.js
  2. +1 −0 styles.css
View
6 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();
};
/**
View
1 styles.css
@@ -48,6 +48,7 @@ a {
.statusbar .copy {
margin-left: 50px;
+ display: none;
}
#clippy {
position: relative;

0 comments on commit 5d168aa

Please sign in to comment.