Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akhodakivskiy committed Mar 3, 2014
1 parent 1913470 commit d4ad99a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions extension/packages/mode-hints/mode-hints.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ hints = require 'mode-hints/hints'
exports.mode_hints =
onEnter: (vim, storage, callback) ->
markers = hints.injectHints(vim.window.document)
if markers.length == 0
vim.enterMode('normal')
else
if markers?.length > 0
storage.markers = markers
storage.callback = callback
else
vim.enterMode('normal')

onLeave: (vim, storage) ->
hints.removeHints(vim.window.document)
Expand Down
10 changes: 5 additions & 5 deletions extension/packages/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ blurActiveElement = (window) ->
# really needed? What if a website has made more elements focusable -- shouldn't those also be
# blurred?
{ activeElement } = window.document
if isElementEditable(activeElement)
if activeElement and isElementEditable(activeElement)
activeElement.blur()

isTextInputElement = (element) ->
Expand All @@ -89,10 +89,10 @@ isElementEditable = (element) ->
isElementVisible = (element) ->
document = element.ownerDocument
window = document.defaultView
computedStyle = window.getComputedStyle(element, null)
return computedStyle.getPropertyValue('visibility') == 'visible' and \
computedStyle.getPropertyValue('display') != 'none' and \
computedStyle.getPropertyValue('opacity') != '0'
if computedStyle = window.getComputedStyle(element, null)
return computedStyle.getPropertyValue('visibility') == 'visible' and \
computedStyle.getPropertyValue('display') != 'none' and \
computedStyle.getPropertyValue('opacity') != '0'

getWindowId = (window) ->
return window
Expand Down

0 comments on commit d4ad99a

Please sign in to comment.