Changeset - 8ca60f8b076f
[Not reviewed]
0 1 0
Brett Smith (brett) - 2 years ago 2020-11-25 16:43:57
brett@sfconservancy.org
js: Bugfix handling the "no window.location.hash" case.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/js/supporter-page.js
Show inline comments
...
 
@@ -102,25 +102,25 @@ $(document).ready(function() {
 
        return false;
 
    };
 
    $(".supporter-type-selector a").bind("click", selectSupportType);
 

	
 
    var selectSupportTypeFromHash = function() {
 
        return supportTypeSelector(window.location.hash).click();
 
    };
 
    $window.bind("hashchange", selectSupportTypeFromHash);
 
    if (selectSupportTypeFromHash().length === 0) {
 
        supportTypeSelector("#annual").click();
 
    }
 

	
 
    var want_id = window.location.hash.substr(1);
 
    var want_id = window.location.hash.substr(1) || "do not match any id";
 
    $('a.read-more').each(function(index, readmore) {
 
        var $readmore = $(readmore)
 
        var $content = $(readmore.hash);
 
        var $header = $content.prev('h3');
 
        if (($header.length && $header[0].id === want_id) || readmore.id === want_id) {
 
            $readmore.hide();
 
        } else {
 
            $content.hide();
 
            $readmore.on('click', function(event) {
 
                $readmore.fadeOut('fast', function() {
 
                    $readmore.replaceWith($content);
 
                    $content.fadeIn('fast');
0 comments (0 inline, 0 general)