Skip to content

Title variable is missing from urls #215

@skyiron

Description

@skyiron

Thank you for jssocials! It is really useful.

I've found that the title variable is missing from shareurls that are supposed to have it.
I checked the code, but couldn't find it defined anywhere.

I've been able to add the title variable with the following changes (4th line from top and 3rd line from the bottom).

_initDefaults: function() {
            this.url = window.location.href;
            this.text = $.trim($("meta[name=description]").attr("content") || $("title").text());
	    this.title =$("title").text();          
        },
		
_initShares: function() {
            this.shares = $.map(this.shares, $.proxy(function(shareConfig) {
                if(typeof shareConfig === "string") {
                    shareConfig = { share: shareConfig };
                }

                var share = (shareConfig.share && shares[shareConfig.share]);

                if(!share && !shareConfig.renderer) {
                    throw Error("Share '" + shareConfig.share + "' is not found");
                }

                return $.extend({ url: this.url, text: this.text, title: this.title }, share, shareConfig); 
            }, this));
        },

I've made a pull request for the above changes #214

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions