Feature #10525
A new button to hide/show the sidebar
| Status: | New | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | UI | |||
| Target version: | 2.4.0 | |||
| Resolution: |
Description
On small screens (Netnooks, laptops) the sidebar take some place that is not necessary all the time.
Here are 2 html snippets :
The first to insert just before the closing h1 or h2 tag of the page title :
<span style="float:right"><a href="#" onclick="$('main').toggleClassName('nosidebar');if($('sidebar_view').src.split('/').pop() == 'minimize.ico'){$('sidebar_view').src='/images/maximize.ico';}else{$('sidebar_view').src='/images/minimize.ico';};"><img src="/images/maximize.ico" id="sidebar_view" /></a></span>
And a second when there are links on the right top corner :
<span><a href="#" onclick="$('main').toggleClassName('nosidebar');if($('sidebar_view').src.split('/').pop() == 'minimize.ico'){$('sidebar_view').src='/images/maximize.ico';}else{$('sidebar_view').src='/images/minimize.ico';};"><img src="/images/maximize.ico" id="sidebar_view" /></a></span>
The 2 icons are to put in public/images
Related issues
History
#1 Updated by Jérôme BATAILLE about 1 year ago
- File maximize.ico added
- File minimize.ico added
#2 Updated by Yuri Makarov about 1 year ago
+1
Additionally,
it would be nice if the size of the sidebar has been fixed.
#3 Updated by Jean-Philippe Lang about 1 year ago
Although this feature is desirable, we just can't add this code to all views. It must be handled by the layout.
Also, hardcoded reference with absolute path to the images won't work with redmine in a sub-uri. It should be handled in the stylesheet.
#4 Updated by Daniel Felix 2 months ago
- Category set to UI
- Target version set to 2.4.0
#12032 has some additional information regarding this issue.
I have implemented a plain JavaScript solution for this in my theme. But this won't be the best solution, as I just safe the sidebar state in a cookie. Which means, that the user have to close the sidebar every time he starts his browser (if he remove cookies after closing or if he use the inPrivate mode).
The better solution would be, to store this information in the session store or in the user profile itself.
Maybe I could provide another patch for this.
I've seen many requests like this, which could be solved with this implementation. This one would be a really small fix, which give a good improvement for smaller screens or for bigger diagrams.
Best regards,
Daniel
#5 Updated by Jérôme BATAILLE about 1 month ago
I have developped a session like memorization, I'll provide a patch.
But the two issues are still available :
- absolute path to the images
- we must modify each view that needs the button, because me must put it a very precise place with particular parameters if there is a context dependent menu in the view.
#6 Updated by Daniel Felix about 1 month ago
Jérôme BATAILLE wrote:
I have developped a session like memorization, I'll provide a patch.
This would be great.
Jérôme BATAILLE wrote:
But the two issues are still available :
- absolute path to the images
This could be fixed. There could be the same image path implementation as with all the other images in Redmine. :-)
- we must modify each view that needs the button, because me must put it a very precise place with particular parameters if there is a context dependent menu in the view.
Well I don't think so. What about just position the sidebar Button directly left beneath the sidebar to let them collapse and the expand button could be moved to the outmost right of the page. The div#content could be manipulated to stretch to the right, where the sidebar resides.
Maybe this would be helpfully.
Maybe you can provide the memorization and I will try to port my scripts to be able to run with trunk instead of the theme. :-)
#7 Updated by Jérôme BATAILLE about 1 month ago
I'll see if I have the time to fix these before to provide the patch.
#8 Updated by Jérôme BATAILLE 24 days ago
- File redmine_smile_togglesidebar_V1.0.tgz added
Here is a plugin.
Tested with Rails 2 and 3.
There is still a manipulation to be done to edit the base layout, to add the button (see the configuration page of the plugin).