Merge "Add hover state to link inspector suggestion items."

This commit is contained in:
Trevor Parscal 2012-11-30 23:16:04 +00:00 committed by Gerrit Code Review
commit c0e7f711c6
2 changed files with 19 additions and 1 deletions

View file

@ -169,6 +169,15 @@
$( this ).addClass( 'selected' );
select.call( this, $( this ).data( 'text' ) );
}
function onItemMouseenter () {
$( this ).addClass( 'hover' );
}
function onItemMouseleave () {
$( this ).removeClass( 'hover' );
}
// Adds a group to the dropdown.
function addGroup( name, group ) {
var $groupWrap,
@ -205,7 +214,12 @@
$item = $( '<div>', options.doc )
.addClass( options.prefix + '-suggest-item' )
.data( 'text', group.items[i] )
.on( 'mousedown', onItemMousedown );
.on( {
'mousedown': onItemMousedown,
'mouseenter': onItemMouseenter,
'mouseleave': onItemMouseleave
} );
if ( 'itemClass' in group ) {
$item.addClass( group.itemClass );
}

View file

@ -142,6 +142,10 @@ body.rtl .ve-ui-suggest-select {
color: #0645AD;
}
.ve-ui-suggest-item.hover {
background: #E5F3FF;
}
.ve-ui-suggest-item-newPage {
color: #BA0000;
}