From 2b6a4060717e852014bfbadcbb5c97d64cd62f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Fri, 23 Feb 2018 22:42:24 +0100 Subject: [PATCH] scratch: Simplify scratch menu --- scratch.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/scratch.js b/scratch.js index 9c7d82c..5050160 100644 --- a/scratch.js +++ b/scratch.js @@ -64,19 +64,9 @@ function enable() { WindowMenu.WindowMenu.prototype._buildMenu = function (window) { let item; - item = this.addAction(_('Scratch'), Lang.bind(this, function() { - if (isScratchWindow(window)) { - window.unmake_above(); - // Make sure to detach and attach the window to the - // workspace - window.stick(); - window.unstick(); - } - else { - window.make_above(); - window.stick(); - } - })); + item = this.addAction(_('Scratch'), () => { + toggle(window); + }); if (isScratchWindow(window)) item.setOrnament(PopupMenu.Ornament.CHECK);