|
170 | 170 | this.overlay.hide(); |
171 | 171 | }; |
172 | 172 |
|
173 | | - this.remove_ui_elements = function(view_id) |
| 173 | + this.remove_ui_elements = function(view_id, starting_from_parent) |
174 | 174 | { |
175 | 175 | var view = window.views[view_id]; |
176 | 176 | if (view && view.isvisible()) |
177 | 177 | { |
178 | 178 | var cell = this.get_cell(view_id); |
179 | | - var container_id = "container-to-" + cell.id; |
| 179 | + if (starting_from_parent) |
| 180 | + { |
| 181 | + var parent_cell = cell && cell.parent; |
| 182 | + if (parent_cell) |
| 183 | + { |
| 184 | + for (var i = 0, cell; cell = parent_cell.children[i]; i++) |
| 185 | + { |
| 186 | + this._remove_ui_elemnts(cell, view_id); |
| 187 | + } |
| 188 | + } |
| 189 | + } |
| 190 | + else |
| 191 | + this._remove_ui_elemnts(cell, view_id); |
| 192 | + } |
| 193 | + }; |
| 194 | + |
| 195 | + this._remove_ui_elemnts = function(cell, view_id) |
| 196 | + { |
| 197 | + if (!cell) |
| 198 | + return; |
| 199 | + |
| 200 | + var container_id = "container-to-" + cell.id; |
| 201 | + var view = cell.tab && window.views[cell.tab.activeTab]; |
| 202 | + if (view) |
| 203 | + { |
180 | 204 | window.messages.post("hide-view", {id: view_id}); |
181 | 205 | view.removeContainerId(container_id); |
182 | 206 | var toolbar_id = "toolbar-to-" + cell.id; |
183 | 207 | var toolbar = window.toolbars[view_id]; |
184 | 208 | if (toolbar) |
185 | 209 | toolbar.removeContainerId(toolbar_id); |
186 | | - [container_id, |
187 | | - toolbar_id, |
188 | | - "overlay-background-to-" + cell.id, |
189 | | - "slider-for-" + cell.id].forEach(function(id) |
190 | | - { |
191 | | - var ele = document.getElementById(id); |
192 | | - if (ele) |
193 | | - ele.parentNode.removeChild(ele); |
194 | | - }); |
195 | 210 | } |
| 211 | + [container_id, |
| 212 | + toolbar_id, |
| 213 | + "overlay-background-to-" + cell.id, |
| 214 | + "slider-for-" + cell.id].forEach(function(id) |
| 215 | + { |
| 216 | + var ele = document.getElementById(id); |
| 217 | + if (ele) |
| 218 | + ele.parentNode.removeChild(ele); |
| 219 | + }); |
196 | 220 | }; |
197 | 221 |
|
198 | 222 | this.add_searchbar = function(searchbar) |
|
0 commit comments