Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Dec 2, 2015
2 parents c03465c + 1dde48c commit c96d3e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
32 changes: 17 additions & 15 deletions extension/lib/commands-frame.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,25 @@ helper_follow = ({id, combine = true}, matcher, {vim}) ->
length = vim.state.markerElements.push(element)
wrapper = {type, semantic, shape, elementIndex: length - 1}

# Combine links with the same href.
if combine and wrapper.type == 'link' and
# If the element has an 'onclick' attribute we cannot be sure that all
# links with this href actually do the same thing. On some pages, such as
# startpage.com, actual proper links have the 'onclick' attribute, so we
# can’t exclude such links in `utils.isProperLink`.
not element.hasAttribute('onclick')
if wrapper.type == 'link'
{href} = element
wrapper.href = href
if href of hrefs
parent = hrefs[href]
wrapper.parentIndex = parent.elementIndex
parent.shape.area += wrapper.shape.area
parent.numChildren++
else
wrapper.numChildren = 0
hrefs[href] = wrapper

# Combine links with the same href.
if combine and wrapper.type == 'link' and
# If the element has an 'onclick' attribute we cannot be sure that all
# links with this href actually do the same thing. On some pages, such
# as startpage.com, actual proper links have the 'onclick' attribute,
# so we can’t exclude such links in `utils.isProperLink`.
not element.hasAttribute('onclick')
if href of hrefs
parent = hrefs[href]
wrapper.parentIndex = parent.elementIndex
parent.shape.area += wrapper.shape.area
parent.numChildren++
else
wrapper.numChildren = 0
hrefs[href] = wrapper

return wrapper

Expand Down
3 changes: 1 addition & 2 deletions extension/lib/help.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ injectHelp = (window, vimfx) ->
computedStyle = window.getComputedStyle(container)
fontSize = originalFontSize =
parseFloat(computedStyle.getPropertyValue('font-size'))
while wrapper.clientHeight < container.clientHeight and
fontSize <= MAX_FONT_SIZE
while container.scrollTopMax == 0 and fontSize <= MAX_FONT_SIZE
fontSize++
container.style.fontSize = "#{fontSize}px"
container.style.fontSize = "#{Math.max(fontSize - 1, originalFontSize)}px"
Expand Down

0 comments on commit c96d3e2

Please sign in to comment.