Add guard for selector overflow (only seen in phantom, not selenium/firefox or dev server/chrome)

This commit is contained in:
Rohan Mitchell
2016-07-07 10:04:11 +10:00
parent 1257ee09f2
commit 13cf5d29de
2 changed files with 19 additions and 1 deletions

View File

@@ -38,7 +38,8 @@ Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) ->
loadWidths = ->
$(element).find("li").not(".more").each (i) ->
scope.allSelectors[i].width = $(this).outerWidth(true)
if i < scope.allSelectors.length
scope.allSelectors[i].width = $(this).outerWidth(true)
return null # So we don't exit the loop weirdly
scope.overFlowSelectors = ->