|
@@ -442,7 +442,10 @@ define [
|
|
|
|
|
|
|
|
_hasSelection = () ->
|
|
_hasSelection = () ->
|
|
|
selection = window.getSelection()
|
|
selection = window.getSelection()
|
|
|
- return _isSelectionWithinPDF(selection) and selection.toString() != ''
|
|
|
|
|
|
|
+ # check the selection type in preference to using
|
|
|
|
|
+ # selection.toString() as the latter is "" when the
|
|
|
|
|
+ # selection is hidden (e.g. while viewing logs)
|
|
|
|
|
+ return _isSelectionWithinPDF(selection) and selection.type is 'Range'
|
|
|
|
|
|
|
|
_isSelectionWithinPDF = (selection) ->
|
|
_isSelectionWithinPDF = (selection) ->
|
|
|
if selection.rangeCount == 0
|
|
if selection.rangeCount == 0
|