 
   addLocationCount: (locations)->
     @locationCount += locations.length
+    if @hasWidgetValue()
+      $.each locations, (idx, l)=>
+        @addToPageCount(l)
     @updateResultStats()
 
   incLocationFound: ->


  ## Search Result Validation Functions

  validateResults: (res)->
    ## TODO: make this work
    false

  hasGardenTheme: (res, target)->
    res['theme_slug'] && (res['theme_slug'].toLowerCase() == target || res['theme'].toLowerCase() == target)

  hasGardenWidget: (res, target)->
    ret = false
    return false if (!res['garden_widgets'] || !res['garden_widget_slugs'])
    $.each res['garden_widgets'], (idx, widget)->
      if !ret && widget.toLowerCase() == target
        ret = true
    return ret if ret
    $.each res['garden_widget_slugs'], (idx, slug)->
      if !ret && slug.toLowerCase() == target
        ret = true
    ret

  hasStatus: (res, target)->
    res['status'] && res['status'].toLowerCase() == target

  getAppName: (elem)->
    $.trim(elem.find('.app-name').text())

  formatWidgetsFoundResults: (elem, res)->
    results = ""
    $.each res['page_configs'], (idx, config)=>
      if @hasGardenWidget(config, @getWidgetValue())
        @incPageFound()
        url = @searchResultsUrl(elem, res['location_slug'], config['page_slug'])
        link = "<a href='#{url}' target='_blank'>#{config['page']}</a>"
