Skip to:
Content

BuddyPress.org

Changeset 10132


Ignore:
Timestamp:
09/24/2015 01:13:18 AM (9 years ago)
Author:
r-a-y
Message:

bp-legacy: Change strict cookie checks to undefined instead of null.

Fixes an issue where no default tab is selected on a BuddyPress directory
page when no cookie is set.

Props davidtcarson.

Fixes #6614 (2.3-branch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/src/bp-templates/bp-legacy/js/buddypress.js

    r9846 r10132  
    18091809    } );
    18101810
    1811     if ( null !== jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) {
     1811    if ( undefined !== jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) {
    18121812        jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
    18131813    }
    18141814
    18151815    /* Activity Tab Set */
    1816     if ( null !== jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
     1816    if ( undefined !== jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
    18171817        jq('.activity-type-tabs li').each( function() {
    18181818            jq(this).removeClass('selected');
     
    18251825function bp_init_objects(objects) {
    18261826    jq(objects).each( function(i) {
    1827         if ( null !== jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) {
     1827        if ( undefined !== jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) {
    18281828            jq('#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
    18291829        }
    18301830
    1831         if ( null !== jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
     1831        if ( undefined !== jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
    18321832            jq('.item-list-tabs li').each( function() {
    18331833                jq(this).removeClass('selected');
     
    19581958
    19591959        /* Update the feed link */
    1960         if ( null !== response.feed_url ) {
     1960        if ( undefined !== response.feed_url ) {
    19611961            jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url);
    19621962        }
Note: See TracChangeset for help on using the changeset viewer.