'Change to the selected document and hide this widget.'

def item_selected(self, item=None):

    if (item is None):
        item = self.currentItem()
    index = self.stack_history[(- (self.currentRow() + 1))]
    self.editor.set_stack_index(index)
    self.editor.current_changed(index)
    self.hide()
