Patch #41827 » 0003_add_automatic_tooltips_to_column_selects.patch
| app/assets/javascripts/application.js | ||
|---|---|---|
|
|
||
|
// columns selection
|
||
|
function moveOptions(theSelFrom, theSelTo) {
|
||
|
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
|
||
|
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo)).
|
||
|
filter('[title]').tooltip("close");
|
||
|
}
|
||
|
|
||
|
function moveOptionUp(theSel) {
|
||
| ... | ... | |
|
});
|
||
|
}
|
||
|
|
||
|
$(function () {
|
||
|
function initTooltips() {
|
||
|
$(".js-overflow-to-tooltip").each(function () {
|
||
|
const currentTitle = this.getAttribute('title');
|
||
|
if ((this.scrollWidth > this.clientWidth ||
|
||
|
this.scrollHeight > this.clientHeight) &&
|
||
|
!currentTitle) {
|
||
|
this.setAttribute('title', this.textContent);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$("[title]:not(.no-tooltip)").tooltip({
|
||
|
show: {
|
||
|
delay: 400
|
||
| ... | ... | |
|
at: "center top"
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
$(initTooltips);
|
||
|
|
||
|
function inlineAutoComplete(element) {
|
||
|
'use strict';
|
||
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
|
||
|
def query_available_inline_columns_options(query)
|
||
|
(query.available_inline_columns - query.columns).
|
||
|
reject(&:frozen?).collect {|column| [column.caption, column.name]}
|
||
|
reject(&:frozen?).collect {|column| column_select_option(column)}
|
||
|
end
|
||
|
|
||
|
def query_selected_inline_columns_options(query)
|
||
|
(query.inline_columns & query.available_inline_columns).
|
||
|
reject(&:frozen?).collect {|column| [column.caption, column.name]}
|
||
|
reject(&:frozen?).collect {|column| column_select_option(column)}
|
||
|
end
|
||
|
|
||
|
def column_select_option(column)
|
||
|
[column.caption, column.name, {class: 'js-overflow-to-tooltip'}]
|
||
|
end
|
||
|
|
||
|
def render_query_columns_selection(query, options={})
|
||
| app/views/my/blocks/_issues.erb | ||
|---|---|---|
|
<div class="contextual">
|
||
|
<%= link_to_function sprite_icon('settings', l(:label_options)), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %>
|
||
|
<%= link_to_function sprite_icon('settings', l(:label_options)), "$('##{block}-settings').toggle(); initTooltips();", :class => 'icon-only icon-settings', :title => l(:label_options) %>
|
||
|
</div>
|
||
|
|
||
|
<h3>
|
||
| app/views/queries/_query_form.html.erb | ||
|---|---|---|
|
|
||
|
<% if @query.available_columns.any? %>
|
||
|
<fieldset id="options" class="collapsible collapsed">
|
||
|
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
|
||
|
<legend onclick="toggleFieldset(this); initTooltips();" class="icon icon-collapsed">
|
||
|
<%= sprite_icon("angle-right") %>
|
||
|
<%= l(:label_options) %>
|
||
|
</legend>
|
||
| ... | ... | |
|
$('input[name=display_type]').change(function (e) {
|
||
|
if ($("#display_type_list").is(':checked')) {
|
||
|
$('table#list-definition').show();
|
||
|
initTooltips();
|
||
|
} else {
|
||
|
$('table#list-definition').hide();
|
||
|
}
|
||
|
-
|
||