mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +01:00
Home: Get weather directly without reload
This commit is contained in:
parent
17018a7a24
commit
a169c39373
@ -635,6 +635,10 @@ class home_ui
|
||||
|
||||
// Update client side
|
||||
$update = array('attributes' => $attributes);
|
||||
if($content && is_array($content))
|
||||
{
|
||||
$update['attributes'] = array_merge_recursive($update['attributes'], $content);
|
||||
}
|
||||
|
||||
// New portlet? Flag going straight to edit mode
|
||||
if($add)
|
||||
|
@ -103,6 +103,7 @@ class home_weather_portlet extends home_portlet
|
||||
|
||||
public function exec($id = null, Etemplate &$etemplate = null)
|
||||
{
|
||||
return ['settings' => $this->get_value()];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,8 +127,7 @@ export class Et2PortletFavorite extends Et2Portlet
|
||||
return super.update_settings(settings)
|
||||
.then(result =>
|
||||
{
|
||||
// Response did not ask for settings, and was not understandable for us
|
||||
if(result == false && !this.nm)
|
||||
if(!this.nm)
|
||||
{
|
||||
// If child was added recently (not loaded in normal reload), resize them all
|
||||
etemplate2.getByTemplate("home.favorite").forEach(et => (<etemplate2>et).resize(undefined))
|
||||
|
@ -131,7 +131,7 @@ export class Et2PortletWeather extends Et2Portlet
|
||||
const current = this.settings?.weather?.current || {weather: [{icon: "question-lg"}], temp: {temp: "?"}};
|
||||
|
||||
// Get the forecast, excluding today
|
||||
let list = this.settings.weather && (Object.values(this.settings?.weather?.list || {}).slice(1) || []);
|
||||
let list = this.settings.weather && (Object.values(this.settings?.weather?.list || {}).slice(1) || []) || [];
|
||||
|
||||
return html`
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user