Habpanel help - refresh background-image

I want to refresh my habpanel background-image and need some help.

Combine
[Custom Javascript code Refresh button]
and
[Custom widget: Dashboard Link]
Can I somehow tell the button to link to another dashboard and then do a refresh of the page?

OR
is there another way to force a refresh of the habpanel background image?

thx

Or is there a possibility to overwrite the background variable with a new url?
Can I send a new url with a button click?

<input type="text" class="form-control" ng-blur="vm.saveOptions()" ng-model="vm.background_image" placeholder="Example: //source.unsplash.com/random" />

You can exploit an HABPanel design flaw for now - the settings are stored in the $rootScope:

<button class="btn btn-default" ng-click="$root.settings.background_image = '//source.unsplash.com/random'">Change background</button>

Note that it will be eventually fixed and won’t work anymore (I’ll consider a changeBackground() function or similar) and the change won’t get saved immediately - but might accidentally get saved afterwards if you manually do it.

thank you. Is working perfectly.
Would be nice to have a background for every dashboard.

Another possible solution I was thinking about, was to add a background-image to the custom css:

.container {
	background-image: url("/static/floor.png");
}

But then Im overwhelmed because I dont know how to do javascript and angular.:sob:

If someone is interested I used this cool widget:
[Custom widget: Dashboard Link] - thx

changed the code to:
<button class="dashboard-link" ng-click="sendCmd(config.habpanel_item, config.dashboard_name); $root.settings.background_image = config.bg_img">
and added a new setting with id bg_img for image address (e.g. /static/bg.jpg)

Now Im able to change the dashboards with this link and the the background also changes.
Lets start with my HABpanel floorplan! :grin: