[gnome-shell] dialog: Use Object.assign() for default property value
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dialog: Use Object.assign() for default property value
- Date: Fri, 12 Jul 2019 19:00:33 +0000 (UTC)
commit 7d2c5c1ac9e3fb9972fb58e4b205aef5f7132d69
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Jun 30 01:03:46 2019 +0200
dialog: Use Object.assign() for default property value
Either Params.parse() or Object.assign() are more concise for providing
default values in object literals (sadly default parameters won't work
here).
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
js/ui/dialog.js | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/dialog.js b/js/ui/dialog.js
index 4989470c4..fd0069cad 100644
--- a/js/ui/dialog.js
+++ b/js/ui/dialog.js
@@ -180,10 +180,8 @@ var MessageDialogContent = GObject.registerClass({
this._subtitle.clutter_text.set(textProps);
this._body.clutter_text.set(textProps);
- if (!params.hasOwnProperty('style_class'))
- params.style_class = 'message-dialog-main-layout';
-
- super._init(params);
+ let defaultParams = { style_class: 'message-dialog-main-layout' };
+ super._init(Object.assign(defaultParams, params));
this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content',
x_expand: true,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]