File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 259
259
if ( duplicate ) {
260
260
t . append ( ", " + duplicate + " of which were duplicated" ) ;
261
261
t . append ( ", " + ( data . nb_statements - duplicate ) + " unique" ) ;
262
+
263
+ // add toggler for displaying only duplicated queries
264
+ var duplicatedText = "Show only duplicated" ;
265
+ var allText = "Show All" ;
266
+ var id = "phpdebugbar-show-duplicates" ;
267
+ t . append ( ". <a id='" + id + "'>" + duplicatedText + "</a>" ) ;
268
+
269
+ $ ( ".phpdebugbar #" + id ) . click ( function ( ) {
270
+ var $this = $ ( this ) ;
271
+ $this . toggleClass ( "shown_duplicated" ) ;
272
+ $this . text ( $this . hasClass ( "shown_duplicated" ) ? allText : duplicatedText ) ;
273
+ $ ( ".phpdebugbar-widgets-sqlqueries .phpdebugbar-widgets-list-item" )
274
+ . not ( ".phpdebugbar-widgets-sql-duplicate" )
275
+ . toggle ( ) ;
276
+
277
+ return false ;
278
+ } ) ;
279
+
262
280
}
263
281
if ( data . accumulated_duration_str ) {
264
282
this . $status . append ( $ ( '<span title="Accumulated duration" />' ) . addClass ( csscls ( 'duration' ) ) . text ( data . accumulated_duration_str ) ) ;
You can’t perform that action at this time.
0 commit comments