diff options
author | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2013-08-20 07:03:55 -0700 |
---|---|---|
committer | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2013-08-20 07:03:55 -0700 |
commit | de40223f4c54256a123ae64780d75c610b003a66 (patch) | |
tree | e71803f129dba1af225cd11dcfc99dd30766ca41 | |
parent | 9496b31d7787182b561bd99f8674901bd7667976 (diff) | |
parent | 8e14229951405d18d1e206c2dabaeeb7644a42e0 (diff) |
Merge pull request #181 from drubin/patch-2
Handle widgets with multiple capital letters
-rw-r--r-- | javascripts/dashing.coffee | 2 |
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) |