Only enable copy icon when there is actually a selection
This commit is contained in:
+5
-1
@@ -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();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,6 +48,7 @@ a {
|
||||
|
||||
.statusbar .copy {
|
||||
margin-left: 50px;
|
||||
display: none;
|
||||
}
|
||||
#clippy {
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user