Skip to content

Instantly share code, notes, and snippets.

@zx1986
Last active March 12, 2016 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zx1986/62472611967fa0c272c2 to your computer and use it in GitHub Desktop.
Save zx1986/62472611967fa0c272c2 to your computer and use it in GitHub Desktop.
Custom Redmine Parent Task Title
$.each( $('td.parent'), function(key, element) {
var tmp = $(element).find('a');
$(element).html(tmp);
});
$("td.parent").each(function ( index ) {
if( $(this).html() ) {
var content = $(this).html().split(':');
$(this).html(content[0]);
}
});
$("td.parent").each(function ( index ) {
if( $(this).html() ) {
var content = $(this).html().split(':');
$(this).html(content[0]);
}
});
var cate_indexs = [];
$("select#project_quick_jump_box option").text(
function(index, text) {
var project_name = text.trim();
if ( !project_name.startsWith('»') &&
index !== 0 && index !== 1
) {
cate_indexs.push(index);
}
}
);
$("#quick-search").append( document.createElement( "br" ) );
for (i = 0; i < cate_indexs.length; i++) {
var key_ = cate_indexs[i+1];
var key = cate_indexs[i];
var new_id = 'box' + key.toString();
var box = $("#project_quick_jump_box").clone();
$(box).attr('id', new_id);
$(box).appendTo($("#quick-search"));
$('select#' + new_id + ' option').text(
function(index, text) {
if (index < key) { $(this).remove(); }
if (index >= key_) { $(this).remove(); }
}
);
}
$("#header").height('140px');
$("#main-menu").css('top', '144px');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment