Changeset 40ee398 in OpenWorkouts-current


Ignore:
Timestamp:
Feb 6, 2019, 1:02:29 PM (4 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
a3c3baa
Parents:
eed2019
Message:

Fixed broken selectors in the last-12-months chart in the user profile page

Location:
ow
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ow/static/js/ow.js

    reed2019 r40ee398  
    251251        filters_selector = spec.filters_selector,
    252252        switcher_selector = spec.switcher_selector,
     253        is_active_class = spec.is_active_class,
     254        is_active_selector = '.' + is_active_class,
    253255        urls = spec.urls,
    254256        current_month = spec.current_month,
     
    287289        $(filters_selector).on('click', function(e) {
    288290            e.preventDefault();
     291            $(filters_selector + is_active_selector).removeClass(is_active_class);
     292            /* $(this).removeClass('is-active'); */
    289293            filter_by = $(this).attr('class').split('-')[1]
     294            $(this).addClass(is_active_class);
    290295            var chart = d3.select(chart_selector);
    291296            chart.selectAll("*").remove();
    292297            render(filter_by, url);
     298
    293299        });
    294300    };
     
    297303        $(switcher_selector).on('click', function(e) {
    298304            e.preventDefault();
     305            $(switcher_selector + is_active_selector).removeClass(is_active_class);
    299306            url = $(this).attr('class').split('-')[1]
     307            $(this).addClass(is_active_class);
    300308            var chart = d3.select(chart_selector);
    301309            chart.selectAll("*").remove();
  • ow/templates/profile.pt

    reed2019 r40ee398  
    177177         filters_selector: '.js-month-stats .js-filters a',
    178178         switcher_selector: '.js-month-stats .js-switcher a',
     179         is_active_class: 'is-active',
    179180         urls: {"monthly": "${request.resource_url(context, 'monthly')}",
    180181                "weekly": "${request.resource_url(context, 'weekly')}"},
Note: See TracChangeset for help on using the changeset viewer.