-
Notifications
You must be signed in to change notification settings - Fork 135
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
Update Shorten Posts extension #1972
base: master
Are you sure you want to change the base?
Conversation
…n't relevant anymore with NPF
727442a
to
92fc782
Compare
wrapperCss: null, | ||
avatarCss: null, | ||
processing: false, | ||
|
||
run: function() { | ||
|
||
this.running = true; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
run: function() { | ||
|
||
this.running = true; | ||
XKit.extensions.shorten_posts.cpanel_check_height(); | ||
|
||
if ($(".posts .post").length > 0) { | ||
if ($("[data-id], .posts .post").length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check should be removed entirely in case the user hard-loads onto a page without posts and then soft-loads onto a page with posts
|
||
$obj.addClass("xkit-shorten-posts-shortened"); | ||
|
||
$article.append("<div class=\"xkit-shorten-posts-embiggen xkit-shorten-posts-embiggen-for-post-" + post_id + "\" data-post-id=\"" + post_id + "\" data-old-height=\"" + height + "\">This post has been shortened. Click here to show the full post</div>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these escapes and string concatenation is a little rough, could this be a template string instead?
Update for react, remove options that aren't relevant anymore with NPF, add a threshold preference as discussed in Discord.