diff --git a/js/misc/params.js b/js/misc/params.js index 8eb6eeb21..3ff8480d2 100644 --- a/js/misc/params.js +++ b/js/misc/params.js @@ -25,6 +25,5 @@ export function parse(params = {}, defaults, allowExtras) { } } - let defaultsCopy = Object.assign({}, defaults); - return Object.assign(defaultsCopy, params); + return {...defaults, ...params}; } diff --git a/js/ui/barLevel.js b/js/ui/barLevel.js index 1b4b7f940..3f4535725 100644 --- a/js/ui/barLevel.js +++ b/js/ui/barLevel.js @@ -38,11 +38,11 @@ export const BarLevel = GObject.registerClass({ this._barLevelActiveBorderColor = null; this._barLevelOverdriveBorderColor = null; - let defaultParams = { + super._init({ style_class: 'barlevel', accessible_role: Atk.Role.LEVEL_BAR, - }; - super._init(Object.assign(defaultParams, params)); + ...params, + }); this.connect('notify::allocation', () => { this._barLevelWidth = this.allocation.get_width(); }); diff --git a/js/ui/dialog.js b/js/ui/dialog.js index bb0084203..11a27a020 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -176,12 +176,12 @@ export const MessageDialogContent = GObject.registerClass({ this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; this._description.clutter_text.line_wrap = true; - let defaultParams = { + super._init({ style_class: 'message-dialog-content', x_expand: true, vertical: true, - }; - super._init(Object.assign(defaultParams, params)); + ...params, + }); this.connect('notify::size', this._updateTitleStyle.bind(this)); this.connect('destroy', this._onDestroy.bind(this)); @@ -269,12 +269,12 @@ export const ListSection = GObject.registerClass({ child: this.list, }); - let defaultParams = { + super._init({ style_class: 'dialog-list', x_expand: true, vertical: true, - }; - super._init(Object.assign(defaultParams, params)); + ...params, + }); this.label_actor = this._title; this.add_child(this._title); @@ -327,8 +327,10 @@ export const ListSectionItem = GObject.registerClass({ textLayout.add_child(this._title); textLayout.add_child(this._description); - let defaultParams = {style_class: 'dialog-list-item'}; - super._init(Object.assign(defaultParams, params)); + super._init({ + style_class: 'dialog-list-item', + ...params, + }); this.label_actor = this._title; this.add_child(this._iconActorBin); diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 22e45766c..ea904ff42 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -795,13 +795,14 @@ class _Draggable extends Signals.EventEmitter { this._animationInProgress = true; // start the animation - this._dragActor.ease(Object.assign(params, { + this._dragActor.ease({ + ...params, opacity: this._dragOrigOpacity, mode: Clutter.AnimationMode.EASE_OUT_QUAD, onComplete: () => { this._onAnimationComplete(this._dragActor, eventTime); }, - })); + }); } _finishAnimation() { diff --git a/js/ui/environment.js b/js/ui/environment.js index 4eea5f13f..6a2b60864 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -211,13 +211,14 @@ function _easeActorProperty(actor, propName, target, params) { } let pspec = actor.find_property(propName); - let transition = new Clutter.PropertyTransition(Object.assign({ + let transition = new Clutter.PropertyTransition({ property_name: propName, interval: new Clutter.Interval({value_type: pspec.value_type}), remove_on_complete: true, repeat_count: repeatCount, auto_reverse: autoReverse, - }, params)); + ...params, + }); actor.add_transition(propName, transition); transition.set_to(target); diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js index 577484137..199f562f8 100644 --- a/js/ui/lightbox.js +++ b/js/ui/lightbox.js @@ -209,12 +209,13 @@ export const Lightbox = GObject.registerClass({ '@effects.radial.brightness', VIGNETTE_BRIGHTNESS, easeProps); this.ease_property( '@effects.radial.sharpness', VIGNETTE_SHARPNESS, - Object.assign({onComplete}, easeProps)); + {onComplete, ...easeProps}); } else { - this.ease(Object.assign(easeProps, { + this.ease({ + ...easeProps, opacity: 255 * this._fadeFactor, onComplete, - })); + }); } } @@ -235,9 +236,9 @@ export const Lightbox = GObject.registerClass({ this.ease_property( '@effects.radial.brightness', 1.0, easeProps); this.ease_property( - '@effects.radial.sharpness', 0.0, Object.assign({onComplete}, easeProps)); + '@effects.radial.sharpness', 0.0, {onComplete, ...easeProps}); } else { - this.ease(Object.assign(easeProps, {opacity: 0, onComplete})); + this.ease({...easeProps, opacity: 0, onComplete}); } } diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js index 65c811168..3c924f42f 100644 --- a/js/ui/shellEntry.js +++ b/js/ui/shellEntry.js @@ -168,8 +168,10 @@ export function addContextMenu(entry, params) { export const CapsLockWarning = GObject.registerClass( class CapsLockWarning extends St.Label { _init(params) { - let defaultParams = {style_class: 'caps-lock-warning-label'}; - super._init(Object.assign(defaultParams, params)); + super._init({ + style_class: 'caps-lock-warning-label', + ...params, + }); this.text = _('Caps lock is on.');