Skip to content
Browse files

Merge pull request #1854 from yohanboniface/fix-all-elements-link

[ui] Fix "*" link not working in carto reference (see mapbox/tilemill#1693)
  • Loading branch information...
2 parents c704e6e + cfc9ddf commit df5e089a6ec0bbeae450e7298d35d18b9803cc6d @springmeyer springmeyer committed Feb 25, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 views/App.bones
View
8 views/App.bones
@@ -167,13 +167,17 @@ view.prototype.toggler = function(ev) {
var link = $(ev.currentTarget);
var parent = link.parents('.toggler');
var target = link.attr('href').split('#').pop();
+ var targetSelector = '.' + target;
+ // mapnik-reference comes with a "*" simbolizer which ends in
+ // a "section-*" class name, but "*" is a metacharacter for jQuery
+ targetSelector = targetSelector.replace('*', '\\*');
if (link.hasClass('disabled')) return false;
$('a', parent).removeClass('active');
- this.$('.' + target).siblings('.active').removeClass('active');
+ this.$(targetSelector).siblings('.active').removeClass('active');
link.addClass('active');
- this.$('.' + target).addClass('active');
+ this.$(targetSelector).addClass('active');
return false;
};

0 comments on commit df5e089

Please sign in to comment.
Something went wrong with that request. Please try again.