Skip to content

Commit

Permalink
Merge pull request #10 from dewski/performance-check
Browse files Browse the repository at this point in the history
Remove performance bar when window.performance isn't available
  • Loading branch information
Garrett Bjerkhoel committed Mar 20, 2013
2 parents 6fe25af + fde624d commit c9b820c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/assets/javascripts/glimpse/views/performance_bar.coffee
Expand Up @@ -29,7 +29,7 @@ class PerformanceBar
# Create a new PerformanceBar view bound to a given element. The el and width
# options should be provided here.
constructor: (options={}) ->
@el = $('.performance-bar')
@el = $('#glimpse-view-performance-bar .performance-bar')
@[k] = v for k, v of options
@width ?= @el.width()
@timing ?= window.performance.timing
Expand Down Expand Up @@ -161,4 +161,7 @@ $(document).on 'pjax:end page:change', (event, xhr) ->
, 0

$ ->
renderPerformanceBar()
if window.performance
renderPerformanceBar()
else
$('#glimpse-view-performance-bar').remove()

0 comments on commit c9b820c

Please sign in to comment.