Showing 1 changed files with 7 additions and 3 deletions
+7 -3
Nasal/menu.nas
... ...
@@ -9,7 +9,7 @@ var pageClass = {
9 9
     },
10 10
 
11 11
     del : func (id = nil) {
12
-        if (id != nil and typeof(v) == 'scalar') {
12
+        if (id != nil and typeof(id) == 'scalar') {
13 13
             delete(me.state, id);
14 14
             id = [ id ];
15 15
         }
... ...
@@ -78,8 +78,8 @@ var pageClass = {
78 78
             end: 9999,            # last canvas element of the scrolling area
79 79
             upper: -9999,         # group printed on the top of the scrolling area
80 80
             lower: 9999,          # group printed at the bottom of the scrolling area
81
-            lines : scroll.lines, # number of lines for the scrolling area
82
-            columns : scroll.columns, # number of objects on each scrolling lines
81
+            lines : scroll != nil ? scroll.lines : 0, # number of lines for the scrolling area
82
+            columns : scroll != nil ? scroll.columns : 0, # number of objects on each scrolling lines
83 83
         };
84 84
         var scrollgroup = {};
85 85
         forindex (var line; state.objects) {
... ...
@@ -166,6 +166,8 @@ var pageClass = {
166 166
             printlog('debug', 'missing parameter l or h');
167 167
             return;
168 168
         }
169
+        var save_x = geometry.x;
170
+        var save_y = geometry.y;
169 171
         me.state[id] = {
170 172
             objects: objects,
171 173
             geometry: geometry,
... ...
@@ -182,5 +184,7 @@ var pageClass = {
182 184
         me.state[id].geometry.x += 10;
183 185
         me.state[id].geometry.y += 16;
184 186
         me.fill(id, scroll);
187
+        geometry.x = save_x;
188
+        geometry.y = save_y;
185 189
     },
186 190
 };