}
void notebookmodel_detach(NotebookModel *model) {
+ // TODO: workaround for a toolkit bug, that reattaching a document
+ // that has sub-documents will not update all bindings
+ if(model->current_note) {
+ //int i = ui_get(model->current_note->model->type);
+ //printf("type: %d\n", i);
+ ui_detach_document(model->ctx, model->current_note->model);
+ model->current_note = NULL;
+ }
+
if(model->current_note && model->current_note->model->modified) {
//notebookmodel_detach_current_note(model);
note_save(model->window->obj, model, model->current_note);