summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Underwood <david.underwood@jadedpixel.com>2013-08-21 14:18:22 -0400
committerDavid Underwood <david.underwood@jadedpixel.com>2013-08-21 14:18:22 -0400
commit81b3cbf08aa6a14d3f0f04a069efb8a7f16cf92b (patch)
treed0affecbb1bc8b68607db8f5023bbc8a3341b778
parent3af326da84251069c4e6f7464d0ae8506b20e98b (diff)
parentde40223f4c54256a123ae64780d75c610b003a66 (diff)
Merge branch 'master' of github.com:Shopify/dashing
* 'master' of github.com:Shopify/dashing: Handle widgets with multiple capital letters
-rw-r--r--javascripts/dashing.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee
index 5712e98..d24bf54 100644
--- a/javascripts/dashing.coffee
+++ b/javascripts/dashing.coffee
@@ -11,7 +11,7 @@ Batman.Filters.dashize = (str) ->
dashes_rx1 = /([A-Z]+)([A-Z][a-z])/g;
dashes_rx2 = /([a-z\d])([A-Z])/g;
- return str.replace(dashes_rx1, '$1_$2').replace(dashes_rx2, '$1_$2').replace('_', '-').toLowerCase()
+ return str.replace(dashes_rx1, '$1_$2').replace(dashes_rx2, '$1_$2').replace(/_/g, '-').toLowerCase()
Batman.Filters.shortenedNumber = (num) ->
return num if isNaN(num)