Fixed Javascript XF.CommentLoader

xfrocks

Well-known member
Affected version
XenForo 2.0 Beta 3
JavaScript:
			if (!this.options.href)
			{
				this.href = this.$target.attr('href');
			}

			if (!this.href)
			{
				console.error('No href for %o', this.$target);
			}

If data-href is used, this.href is not set and it will trigger the console.error call.
 
I've updated the code to this:
JavaScript:
            if ($target.length)
            {
                this.$loaderTarget = $target;
            }
            else
            {
                console.error('No loader target for %o', this.$target);
                return;
            }

            this.href = this.options.href || this.$target.attr('href');

            if (!this.href)
            {
                console.error('No href for %o', this.$target);
            }
 
Back
Top Bottom