cleanup: Use object destructuring where possible

ES6's destructuring is a nice way of assigning a variable in a concise way,
without duplicating the name of the object property. Use it consistently
where possible.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
This commit is contained in:
Florian Müllner
2019-08-11 02:03:39 +02:00
committed by Florian Müllner
parent a1f38d818d
commit 2497dc6d31
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
// Start apps on custom workspaces
/* exported init enable disable */
const Shell = imports.gi.Shell;
const { Shell } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
+2 -2
View File
@@ -751,7 +751,7 @@ const WindowList = GObject.registerClass({
'keyboard-visible-changed',
(o, state) => {
Main.layoutManager.keyboardBox.visible = state;
let keyboardBox = Main.layoutManager.keyboardBox;
let { keyboardBox } = Main.layoutManager;
keyboardBox.visible = state;
if (state) {
Main.uiGroup.set_child_above_sibling(
@@ -858,7 +858,7 @@ const WindowList = GObject.registerClass({
let children = this._windowList.get_children();
let [, childWidth] = children[0].get_preferred_width(-1);
let spacing = this._windowList.layout_manager.spacing;
let { spacing } = this._windowList.layout_manager;
let workspace = global.workspace_manager.get_active_workspace();
let windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
+1 -1
View File
@@ -158,7 +158,7 @@ var MyWorkspacesView = class extends WorkspacesView.WorkspacesView {
}
_onKeyPress(s, o) {
let viewSelector = Main.overview.viewSelector;
let { viewSelector } = Main.overview;
if (viewSelector._activePage != viewSelector._workspacesPage)
return false;