mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +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 client side
|
||||||
$update = array('attributes' => $attributes);
|
$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
|
// New portlet? Flag going straight to edit mode
|
||||||
if($add)
|
if($add)
|
||||||
|
@ -103,6 +103,7 @@ class home_weather_portlet extends home_portlet
|
|||||||
|
|
||||||
public function exec($id = null, Etemplate &$etemplate = null)
|
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)
|
return super.update_settings(settings)
|
||||||
.then(result =>
|
.then(result =>
|
||||||
{
|
{
|
||||||
// Response did not ask for settings, and was not understandable for us
|
if(!this.nm)
|
||||||
if(result == false && !this.nm)
|
|
||||||
{
|
{
|
||||||
// If child was added recently (not loaded in normal reload), resize them all
|
// If child was added recently (not loaded in normal reload), resize them all
|
||||||
etemplate2.getByTemplate("home.favorite").forEach(et => (<etemplate2>et).resize(undefined))
|
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: "?"}};
|
const current = this.settings?.weather?.current || {weather: [{icon: "question-lg"}], temp: {temp: "?"}};
|
||||||
|
|
||||||
// Get the forecast, excluding today
|
// 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`
|
return html`
|
||||||
<div
|
<div
|
||||||
|
Loading…
Reference in New Issue
Block a user