This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Pages: 1 - Last Post: 10-Mar-2018 03:05 Last Post By: AnCa Threads: [ Previous | Next ]
AnCa

Posts: 1,318
Registered: 25-Mar-2005
Added jalbumWidgetbar class to html element when widgetbar visible
Posted: 02-Mar-2018 18:05
 
  Click to reply to this thread Reply
I've just added the class "jalbumWidgetbar" to the html element to every page where the widgetbar is visible, so you can add a special css-style to make room for the widget bar.

When the bar is minimized (only the + button) there is a jalbumWidgetbarMinimized class added instead.

I've also made the widgets work if you are using the history.pushState method to update the URL.
jGromit

Posts: 14,515
Registered: 31-Jan-2006
Re: Added jalbumWidgetbar class to html element when widgetbar visible
Posted: 02-Mar-2018 22:07   in response to: AnCa in response to: AnCa
 
  Click to reply to this thread Reply
I've updated the announcement at the top of the widgets forum section so that it lists only current skins that support widgets (i.e., none of the skins that have been banished to the "legacy" section).

I picked up only those skins that have the "jAlbum widget support" feature checked. So, there might be a few more, but I wasn't about to test all of the rest!
davidekholm

Posts: 6,666
Registered: 18-Oct-2002
Re: Added jalbumWidgetbar class to html element when widgetbar visible
Posted: 05-Mar-2018 11:54   in response to: AnCa in response to: AnCa
 
  Click to reply to this thread Reply
Thanks Anders
ctwist

Posts: 967
Registered: 27-Sep-2003
Re: Added jalbumWidgetbar class to html element when widgetbar visible
Posted: 10-Mar-2018 02:31   in response to: AnCa in response to: AnCa
 
  Click to reply to this thread Reply
Previously in Mirage, I prevented the widget bar from overlapping the body by adding a 20px bottom margin in the skin's CSS file.
body {
	margin-bottom: <%= engine.isWidgetInjection() ? "20px" : "0" %>;
}
This works, but the margin remains if the user hides the widget bar.

A better technique is to add this to the CSS file.
.jalbumWidgetbar body {
	margin-bottom: 20px;
}
If the user minimises the widget bar, the unnecessary margin is removed.
AnCa

Posts: 1,318
Registered: 25-Mar-2005
Re: Added jalbumWidgetbar class to html element when widgetbar visible
Posted: 10-Mar-2018 03:05   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
A better technique is to add this to the CSS file.
.jalbumWidgetbar body {
	margin-bottom: 20px;
}
If the user minimises the widget bar, the unnecessary margin is removed.

Yes, a perfect use of my addition!

Not sure when isWidgetInjection() is true, but I assume it is as long as the widget code is added to the page, even if there are no widgets enabled. And in that case the old method would add an unnecessary margin, while the new method won't.

And if you want a margin both when the bar is visible and minimized (but not when there is not bar at all) you can use
.jalbumWidgetbar body, .jalbumWidgetbarMinimized body {
	margin-bottom: 20px;
}

:)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums