Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9bbb6912

Von Moritz Bunkus vor mehr als 10 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
295 295
      ->html('#section-header-' . $self->item->id, $html)
296 296
      ->show('#section-header-' . $self->item->id)
297 297
      ->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item))
298
      ->prop('#fb-' . $self->item->id, 'title', $self->item->content_excerpt)
298
      ->prop('#fb-' . $self->item->id . ' a', 'title', $self->item->content_excerpt)
299
      ->addClass('#fb-' . $self->item->id . ' a', 'tooltip')
300
      ->reinit_widgets
299 301
      ->render($self);
300 302
  }
301 303

  
......
310 312
  $self->js
311 313
    ->remove('#' . $prefix . '_form')
312 314
    ->replaceWith('#' . $id_prefix . 'top-' . $self->item->id, $html_top)
313
    ->prop('#fb-' . $self->item->id, 'title', $self->item->content_excerpt)
315
    ->prop('#fb-' . $self->item->id . ' a', 'title', $self->item->content_excerpt)
316
    ->addClass('#fb-' . $self->item->id . ' a', 'tooltip')
317
    ->reinit_widgets
314 318
    ->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item));
315 319

  
316 320
  $self->replace_bottom($self->item, id_prefix => $id_prefix);
SL/Controller/RequirementSpecTextBlock.pm
136 136
    ->replaceWith('#text-block-' . $self->text_block->id, $html)
137 137
    ->run(SORTABLE_PICTURE_LIST())
138 138
    ->jstree->rename_node('#tree', '#tb-' . $self->text_block->id, $self->text_block->title)
139
    ->prop('#tb-' . $self->text_block->id, 'title', $self->text_block->content_excerpt)
139
    ->prop('#tb-' . $self->text_block->id . ' a', 'title', $self->text_block->content_excerpt)
140
    ->addClass('#tb-' . $self->text_block->id . ' a', 'tooltip')
141
    ->reinit_widgets
140 142
    ->render($self);
141 143
}
142 144

  
js/requirement_spec.js
102 102
  }, kivi.eval_json_result);
103 103
};
104 104

  
105
ns.setup_tooltip_for_tree_node = function(li) {
106
  $(li).find('a').prop('title', $(li).prop('title')).tooltip();
107
  $(li).prop('title', '');
108
};
109

  
110
ns.tree_loaded = function(event) {
111
  var id = $('#tree').data('initially_selected_node');
112
  if (id)
113
    $.jstree._reference("#tree").select_node(id, true);
114

  
115
  $('#tree li[title!=""]').each(function(idx, elt) {
116
    ns.setup_tooltip_for_tree_node(elt);
117
  });
118
};
119

  
120
ns.tree_node_created = function(event, data) {
121
  console.info("created ", data);
122
  if (data && data.rslt && data.rslt.obj)
123
    ns.setup_tooltip_for_tree_node(data.rslt.obj);
124
};
125

  
126
ns.initialize_requirement_spec = function(data) {
127
  $('#tree').data('initially_selected_node', data.initially_selected_node);
128

  
129
  $('#tree')
130
    .bind('create_node.jstree', ns.tree_node_created)
131
    .bind('move_node.jstree',   ns.tree_node_moved)
132
    .bind('click.jstree',       ns.tree_node_clicked)
133
    .bind('loaded.jstree',      ns.tree_loaded)
134
    .jstree({
135
      core: {
136
        animation: 0,
137
        initially_open: data.initially_open,
138
      },
139
      json_data: {
140
        data: data.tree_data
141
      },
142
      crrm: {
143
        move: {
144
          check_move: ns.tree_check_move,
145
          open_move:  true
146
        }
147
      },
148
      themes: {
149
        theme: "requirement-spec"
150
      },
151
      plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
152
    });
153

  
154
  ns.create_context_menus(data.is_template);
155
  $('#requirement_spec_tabs').on("tabsbeforeactivate", ns.tabs_before_activate);
156
};
157

  
105 158
// -------------------------------------------------------------------------
106 159
// ------------------------------ text blocks ------------------------------
107 160
// -------------------------------------------------------------------------
templates/webpages/requirement_spec/show.html
86 86
[%- END -%]
87 87
  ];
88 88

  
89
  $('#tree')
90
  .bind('loaded.jstree', function() {
91
    kivi.reinit_widgets();
89
  kivi.requirement_spec.initialize_requirement_spec({
90
      initially_open:          initially_open
91
    , tree_data:               tree_data
92
    , is_template:             [% SELF.requirement_spec.is_template ? 'true' : 'false' %]
92 93
[% IF SELF.requirement_spec_item %]
93
    $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
94
    , initially_selected_node: '#fb-[% SELF.requirement_spec_item.id %]'
94 95
[% END %]
95
  })
96
  .jstree({
97
    core: {
98
      animation: 0,
99
      initially_open: initially_open,
100
    },
101
    json_data: {
102
      data: tree_data
103
    },
104
    crrm: {
105
      move: {
106
        check_move: kivi.requirement_spec.tree_check_move,
107
        open_move:  true
108
      }
109
    },
110
    themes: {
111
      theme: "requirement-spec"
112
    },
113
    plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
114
  })
115
  .bind("move_node.jstree", kivi.requirement_spec.tree_node_moved)
116
  .bind("click.jstree",     kivi.requirement_spec.tree_node_clicked);
117

  
118
  kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]);
119
  $('#requirement_spec_tabs').on("tabsbeforeactivate", kivi.requirement_spec.tabs_before_activate);
96
  });
120 97
});
121 98

  
122 99
  -->

Auch abrufbar als: Unified diff