@@ -6752,9 +6752,10 @@ define('scribe-plugin-link-ui',[],function () {
67526752 $input = $ ( '.link-tools input' , editorEl ) ,
67536753 placeHolder = '#replaceme' ;
67546754 var $results = $ ( '.search-results' , $linkTools ) ;
6755+ var $filters = $ ( '.filters' , $linkTools ) ;
67556756
67566757 // this provides a way to externally udpate the results element.
6757- var searchHandler = config . searchHandler || function ( term , resultsElement ) { } ;
6758+ var searchHandler = config . searchHandler || function ( term , resultsElement , filtersElement ) { } ;
67586759
67596760 linkPromptCommand . nodeName = 'A' ;
67606761
@@ -6775,6 +6776,13 @@ define('scribe-plugin-link-ui',[],function () {
67756776
67766777 $ ( '.ok' , $linkTools ) . click ( confirmInput ) ;
67776778
6779+ $filters . click ( function ( e ) {
6780+ var buttonElement = $ ( e . target ) . closest ( 'button' ) ;
6781+ if ( buttonElement . length === 1 ) {
6782+ buttonElement . toggleClass ( 'active' ) ;
6783+ }
6784+ } ) ;
6785+
67786786 $results . click ( function ( e ) {
67796787 var linkElement = $ ( e . target ) . closest ( 'a' ) ;
67806788 if ( linkElement . length === 1 ) {
@@ -6809,7 +6817,7 @@ define('scribe-plugin-link-ui',[],function () {
68096817 var v = $input . val ( ) ;
68106818 if ( isSearchTerm ( v ) ) {
68116819 clearTimeout ( searchTimeout ) ;
6812- searchTimeout = setTimeout ( searchHandler , 200 , v , $results ) ;
6820+ searchTimeout = setTimeout ( searchHandler , 200 , v , $results , $filters ) ;
68136821 $results . show ( ) ;
68146822 }
68156823 else {
0 commit comments