Only enable copy icon when there is actually a selection
This commit is contained in:
+5
-1
@@ -33,9 +33,13 @@
|
|||||||
*/
|
*/
|
||||||
prepareClippyButton = function(e) {
|
prepareClippyButton = function(e) {
|
||||||
var selection = editor.getSession().doc.getTextRange(editor.getSelectionRange());
|
var selection = editor.getSession().doc.getTextRange(editor.getSelectionRange());
|
||||||
|
if (!selection) {
|
||||||
|
$('.statusbar .copy').hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$('#clippy embed').attr('FlashVars', 'text=' + selection);
|
$('#clippy embed').attr('FlashVars', 'text=' + selection);
|
||||||
$('#clippy param[name="FlashVars"]').attr('value', '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 {
|
.statusbar .copy {
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
#clippy {
|
#clippy {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
Reference in New Issue
Block a user