From 7d9bb459b404526aaf49955617f8408cbad4ff26 Mon Sep 17 00:00:00 2001 From: abakkk Date: Fri, 11 Oct 2019 09:39:17 +0200 Subject: [PATCH] Create drawing menu on demand --- draw.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/draw.js b/draw.js index 9c634d4..77291cd 100644 --- a/draw.js +++ b/draw.js @@ -80,7 +80,6 @@ var DrawingArea = new Lang.Class({ this.settings = Convenience.getSettings(); this.emitter = new DrawingAreaEmitter(); this.monitor = monitor; - this.menu = new DrawingMenu(this); this.helper = helper; this.elements = []; @@ -98,6 +97,12 @@ var DrawingArea = new Lang.Class({ this._loadJson(); }, + get menu() { + if (!this._menu) + this._menu = new DrawingMenu(this); + return this._menu; + }, + _redisplay: function() { // force area to emit 'repaint' this.queue_repaint();