Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9bbb6912

Von Moritz Bunkus vor fast 11 Jahren hinzugefügt

  • ID 9bbb6912f72c14e23a25ec0a26e8d68b45b224b8
  • Vorgänger 786437b6
  • Nachfolger e8041cc6

Pflichtenheftitems & -textblöcke: Tooltips im Baum mit Inhaltsauszug anzeigen gefixt

Tooltips am <li> haben das Problem, dass sie bei sehr hohen
<li>s (gerade bei ganzen Abschnitten, aber auch bei Funktionsblöcken
mit sehr vielen Unterfunktionsblöcken) unterhalb des <li> angezeigt
werden.

Mit diesem Fix werden sie unterhalb des <a> innerhalb des <li>
angezeigt, der nur die eine Textzeile hoch ist.

Unterschiede anzeigen:

SL/Controller/RequirementSpecItem.pm
->html('#section-header-' . $self->item->id, $html)
->show('#section-header-' . $self->item->id)
->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item))
->prop('#fb-' . $self->item->id, 'title', $self->item->content_excerpt)
->prop('#fb-' . $self->item->id . ' a', 'title', $self->item->content_excerpt)
->addClass('#fb-' . $self->item->id . ' a', 'tooltip')
->reinit_widgets
->render($self);
}
......
$self->js
->remove('#' . $prefix . '_form')
->replaceWith('#' . $id_prefix . 'top-' . $self->item->id, $html_top)
->prop('#fb-' . $self->item->id, 'title', $self->item->content_excerpt)
->prop('#fb-' . $self->item->id . ' a', 'title', $self->item->content_excerpt)
->addClass('#fb-' . $self->item->id . ' a', 'tooltip')
->reinit_widgets
->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item));
$self->replace_bottom($self->item, id_prefix => $id_prefix);
SL/Controller/RequirementSpecTextBlock.pm
->replaceWith('#text-block-' . $self->text_block->id, $html)
->run(SORTABLE_PICTURE_LIST())
->jstree->rename_node('#tree', '#tb-' . $self->text_block->id, $self->text_block->title)
->prop('#tb-' . $self->text_block->id, 'title', $self->text_block->content_excerpt)
->prop('#tb-' . $self->text_block->id . ' a', 'title', $self->text_block->content_excerpt)
->addClass('#tb-' . $self->text_block->id . ' a', 'tooltip')
->reinit_widgets
->render($self);
}
js/requirement_spec.js
}, kivi.eval_json_result);
};
ns.setup_tooltip_for_tree_node = function(li) {
$(li).find('a').prop('title', $(li).prop('title')).tooltip();
$(li).prop('title', '');
};
ns.tree_loaded = function(event) {
var id = $('#tree').data('initially_selected_node');
if (id)
$.jstree._reference("#tree").select_node(id, true);
$('#tree li[title!=""]').each(function(idx, elt) {
ns.setup_tooltip_for_tree_node(elt);
});
};
ns.tree_node_created = function(event, data) {
console.info("created ", data);
if (data && data.rslt && data.rslt.obj)
ns.setup_tooltip_for_tree_node(data.rslt.obj);
};
ns.initialize_requirement_spec = function(data) {
$('#tree').data('initially_selected_node', data.initially_selected_node);
$('#tree')
.bind('create_node.jstree', ns.tree_node_created)
.bind('move_node.jstree', ns.tree_node_moved)
.bind('click.jstree', ns.tree_node_clicked)
.bind('loaded.jstree', ns.tree_loaded)
.jstree({
core: {
animation: 0,
initially_open: data.initially_open,
},
json_data: {
data: data.tree_data
},
crrm: {
move: {
check_move: ns.tree_check_move,
open_move: true
}
},
themes: {
theme: "requirement-spec"
},
plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
});
ns.create_context_menus(data.is_template);
$('#requirement_spec_tabs').on("tabsbeforeactivate", ns.tabs_before_activate);
};
// -------------------------------------------------------------------------
// ------------------------------ text blocks ------------------------------
// -------------------------------------------------------------------------
templates/webpages/requirement_spec/show.html
[%- END -%]
];
$('#tree')
.bind('loaded.jstree', function() {
kivi.reinit_widgets();
kivi.requirement_spec.initialize_requirement_spec({
initially_open: initially_open
, tree_data: tree_data
, is_template: [% SELF.requirement_spec.is_template ? 'true' : 'false' %]
[% IF SELF.requirement_spec_item %]
$.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
, initially_selected_node: '#fb-[% SELF.requirement_spec_item.id %]'
[% END %]
})
.jstree({
core: {
animation: 0,
initially_open: initially_open,
},
json_data: {
data: tree_data
},
crrm: {
move: {
check_move: kivi.requirement_spec.tree_check_move,
open_move: true
}
},
themes: {
theme: "requirement-spec"
},
plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
})
.bind("move_node.jstree", kivi.requirement_spec.tree_node_moved)
.bind("click.jstree", kivi.requirement_spec.tree_node_clicked);
kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]);
$('#requirement_spec_tabs').on("tabsbeforeactivate", kivi.requirement_spec.tabs_before_activate);
});
});
-->

Auch abrufbar als: Unified diff