Skip to content

Commit

Permalink
Merge pull request #13350 from jdalsem/widget-title-update
Browse files Browse the repository at this point in the history
fix(widgets): correctly update widget title after widget update
  • Loading branch information
jdalsem committed Dec 2, 2020
2 parents 34ef283 + 95535d2 commit 807f0b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion views/default/elgg/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,17 @@ define(['elgg', 'jquery', 'elgg/ready'], function (elgg, $) {
$widgetContent.html(json.output.content);
if (typeof (json.output.title) != "undefined") {
var $widgetTitle = $widgetContent.parent().parent().find('.elgg-widget-title');
$widgetTitle.html(json.title);

var newWidgetTitle = json.output.title;
if (typeof (json.output.href) != "undefined") {
newWidgetTitle = "<a href='" + json.output.href + "' class='elgg-anchor'><span class='elgg-anchor-label'>" + newWidgetTitle + "</span></a>";
}

$widgetTitle.html(newWidgetTitle);
}
}
});

event.preventDefault();
};

Expand Down

0 comments on commit 807f0b1

Please sign in to comment.