News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

September 21, 2019, 07:02:23 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188927
  • Total Topics: 20755
  • Online Today: 101
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 4
Guests: 69
Total: 73

Author Topic: Collapse button  (Read 1594 times)

0 Members and 1 Guest are viewing this topic.

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #10 on: December 04, 2018, 10:30:23 AM »
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.

Online @rjen

  • Support Team
  • *
  • Posts: 1823
    • FJR-club Nederland
Re: Collapse button
« Reply #11 on: December 04, 2018, 12:50:46 PM »
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 TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #12 on: December 04, 2018, 01:18:34 PM »
I like the solution. So much that I just coded is into my repository.

Try this instead...

Code: [Select]
$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);

Online @rjen

  • Support Team
  • *
  • Posts: 1823
    • FJR-club Nederland
Re: Collapse button
« Reply #13 on: December 04, 2018, 01:25:08 PM »
Better  O0

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

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #14 on: December 04, 2018, 01:26:42 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

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #15 on: December 04, 2018, 01:29:19 PM »
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.

Online @rjen

  • Support Team
  • *
  • Posts: 1823
    • FJR-club Nederland
Re: Collapse button
« Reply #16 on: December 04, 2018, 01:55:44 PM »
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).

Code: [Select]
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 TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #17 on: December 04, 2018, 02:54:56 PM »
I don't get that, I get the can't find the element error

Online tino

  • Developer
  • *
  • Posts: 1652
Re: Collapse button
« Reply #18 on: December 04, 2018, 02:57:07 PM »
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.

Online @rjen

  • Support Team
  • *
  • Posts: 1823
    • FJR-club Nederland
Re: Collapse button
« Reply #19 on: December 04, 2018, 03:00:59 PM »
Yep, I use Chrome
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info