docs: function closeDocked(wid, hide) {
          var d, i, len, width, closed;
          d = node.widgets.docked;
          len = d.length;
          for (i = 0; i < len; i++) {
              if (width) {
                  d[i].panelDiv.style.right =
                      (getPxNum(d[i].panelDiv.style.right) - width) + 'px';
              }
              else if (d[i].wid === wid) {
                  width = d[i].dockedOffsetWidth;
                  // Remove from docked list.
                  closed = node.widgets.docked.splice(i, 1)[0];
                  if (hide) {
                      node.widgets.dockedHidden.push(closed);
                      closed.hide();
  
                      if (!node.widgets.boxSelector) {
                          node.widgets.boxSelector =
                              node.widgets.append('BoxSelector', document.body, {
                                  className: 'docked-left',
                                  getId: function(i) { return i.wid; },
                                  getDescr: function(i) { return i.title; },
                                  onclick: function(i, id) {
                                      i.show();
                                      // First add back to docked list,
                                      // then set right style.
                                      node.widgets.docked.push(i);
                                      setRightStyle(i);
                                      this.removeItem(id);
                                      if (this.items.length === 0) {
                                          this.destroy();
                                          node.widgets.boxSelector = null;
                                      }
                                  },
                              });
  
                      }
                      node.widgets.boxSelector.addItem(closed);
                  }
                  // Decrement len and i.
                  len--;
                  i--;
              }
          }
          return !!width;
      }