Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title variable is missing from urls #215

Open
skyiron opened this issue Sep 11, 2018 · 0 comments
Open

Title variable is missing from urls #215

skyiron opened this issue Sep 11, 2018 · 0 comments

Comments

@skyiron
Copy link

skyiron commented Sep 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant