Skip to content

Commit

Permalink
Make buttons visible only on hover over container
Browse files Browse the repository at this point in the history
Make some buttons visible only when hovering over it's container.

Applied to: adm_config_report.php, view.php (bugnotes)

Fixes: #22872
  • Loading branch information
cproensa authored and dregad committed Sep 9, 2017
1 parent aee0080 commit b0c652f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adm_config_report.php
Expand Up @@ -426,7 +426,7 @@ function check_config_value( $p_config ) {

?>
<!-- Repeated Info Rows -->
<tr>
<tr class="visible-on-hover-toggle">
<td>
<?php echo ($v_user_id == 0) ? lang_get( 'all_users' ) : string_display_line( user_get_name( $v_user_id ) ) ?>
</td>
Expand All @@ -439,7 +439,7 @@ function check_config_value( $p_config ) {
if( $t_read_write_access ) {
?>
<td class="center">
<div class="btn-group inline">
<div class="btn-group inline visible-on-hover">
<?php
if( config_can_delete( $v_config_id ) ) {
# Update button (will populate edit form at page bottom)
Expand Down
4 changes: 2 additions & 2 deletions bugnote_view_inc.php
Expand Up @@ -153,7 +153,7 @@
$t_time_tracking_hhmm = '';
}
?>
<tr class="bugnote" id="c<?php echo $t_activity['id'] ?>">
<tr class="bugnote visible-on-hover-toggle" id="c<?php echo $t_activity['id'] ?>">
<td class="category">
<div class="pull-left padding-2"><?php print_avatar( $t_activity['user_id'], 'bugnote', 80 ); ?>
</div>
Expand Down Expand Up @@ -199,7 +199,7 @@
?>
<div class="clearfix"></div>
<div class="space-2"></div>
<div class="btn-group-sm">
<div class="btn-group visible-on-hover">
<?php
# show edit button if the user is allowed to edit this bugnote
if( $t_activity['can_edit'] ) {
Expand Down
15 changes: 15 additions & 0 deletions js/common.js
Expand Up @@ -378,6 +378,21 @@ $(document).ready( function() {
$(document).on('shown.bs.dropdown', '#dropdown_projects_menu', function() {
$(this).find(".dropdown-menu li.active a").focus();
});

/**
* Manage visiblity on hover trigger objects
*/
if( $('.visible-on-hover-toggle').length ) {
$('.visible-on-hover-toggle').hover(
function(e){ // handlerIn
$(e.currentTarget).find('.visible-on-hover').removeClass('invisible');
},
function(e){ // handlerOut
$(e.currentTarget).find('.visible-on-hover').addClass('invisible');
}
);
$('.visible-on-hover').addClass('invisible');
}
});

function setBugLabel() {
Expand Down

0 comments on commit b0c652f

Please sign in to comment.