equal
deleted
inserted
replaced
10 'use strict'; |
10 'use strict'; |
11 var selector, base64, painter, |
11 var selector, base64, painter, |
12 colorscheme = {}, |
12 colorscheme = {}, |
13 elements = []; |
13 elements = []; |
14 |
14 |
15 $(document).ready( function() { |
15 $( function() { |
16 // Detection for browser SVG capability. |
16 // Detection for browser SVG capability. |
17 if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) { |
17 if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) { |
18 $( document.body ).removeClass( 'no-svg' ).addClass( 'svg' ); |
18 $( document.body ).removeClass( 'no-svg' ).addClass( 'svg' ); |
19 wp.svgPainter.init(); |
19 wp.svgPainter.init(); |
20 } |
20 } |
158 } else { |
158 } else { |
159 // Paint icon in base color. |
159 // Paint icon in base color. |
160 painter.paintElement( $element, 'base' ); |
160 painter.paintElement( $element, 'base' ); |
161 |
161 |
162 // Set hover callbacks. |
162 // Set hover callbacks. |
163 $menuitem.hover( |
163 $menuitem.on( 'mouseenter', function() { |
164 function() { |
164 painter.paintElement( $element, 'focus' ); |
165 painter.paintElement( $element, 'focus' ); |
165 } ).on( 'mouseleave', function() { |
166 }, |
166 // Match the delay from hoverIntent. |
167 function() { |
167 window.setTimeout( function() { |
168 // Match the delay from hoverIntent. |
168 painter.paintElement( $element, 'base' ); |
169 window.setTimeout( function() { |
169 }, 100 ); |
170 painter.paintElement( $element, 'base' ); |
170 } ); |
171 }, 100 ); |
|
172 } |
|
173 ); |
|
174 } |
171 } |
175 }); |
172 }); |
176 }, |
173 }, |
177 |
174 |
178 paintElement: function( $element, colorType ) { |
175 paintElement: function( $element, colorType ) { |