TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 12:36:15 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 77
  • Total: 78
  • @rjen

Collapse button

Started by bigguy, December 04, 2018, 12:36:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tino

Quote from: @rjen on December 04, 2018, 05:16:36 PM
That is not what I meant, but maybe even better...  O0

It will only show for logged in users mind. So will need some thinking about for people who aren't logged in. Although you could argue they shouldn't be able to collapse the panels.

@rjen

I like the solution. So much that I just coded is into my repository.

So 2.0 remains the way it was, 2.1 can get that location.
The only downside is that the collapse buttons will only be available for logged-in users.

How do the others feel about that? Shall I commit it?
If we do not like it, we can always reverse it again...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on December 04, 2018, 07:50:46 PM
I like the solution. So much that I just coded is into my repository.

Try this instead...

$buffer = preg_replace('~<div class="navigate_section">\s*<ul>~', '<div class="navigate_section"><ul><span class="tp_upshrink" style="float:right; margin-top:6px; padding-left:10px;">'.$context['TPortal']['upshrinkpanel'].'</span>', $buffer);

@rjen

Better  O0

but somehow two buttons go missing for guests... need to check why first.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on December 04, 2018, 08:25:08 PM
Better  O0

but somehow two buttons go missing for guests... need to check why first.

Do you have the css and my inline styling? It's ok for me

tino

It does need different styling on less than a 720px screen though. Probably align it to the left so it fits with the other items.

@rjen

Ok, fixed it. Looks good, I'll submit the PR.


I just noticed that in the console the toggle is throwing some error (not related to this change).


index.php:103 Uncaught TypeError: Cannot read property 'style' of null
    at togglepanel (index.php:103)
    at HTMLAnchorElement.onclick (index.php:441)


What's that?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

I don't get that, I get the can't find the element error

tino

Ok its the same error Chrome ( which I guess you use ) reports it differently to Firefox. It means it can't find the elementid img which is correct as it's not called that.

@rjen

Running Latest TP on SMF2.1 at: www.fjr-club.nl