Jonas Kress (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312233

Change subject: Display examples count in example dialog
......................................................................

Display examples count in example dialog

Change-Id: I2c93974a8f2f1c7226652973d8b6487ec921778a
---
M index.html
M wikibase/queryService/ui/QueryExampleDialog.js
2 files changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/33/312233/1

diff --git a/index.html b/index.html
index ba3b9f4..adb86e8 100644
--- a/index.html
+++ b/index.html
@@ -193,7 +193,9 @@
                                <div class="tagCloud"></div>
                                         <div class="tagFilter"></div>
                                        <div class="input-group">
-                                               <span 
class="input-group-addon"><span class="glyphicon glyphicon-filter" 
aria-hidden="true"></span></span> <input type="text" class="tableFilter 
form-control" placeholder="Type to filter">
+                                               <span 
class="input-group-addon"><span class="glyphicon glyphicon-filter" 
aria-hidden="true"></span></span> 
+                                               <input type="text" 
class="tableFilter form-control" placeholder="Type to filter">
+                                               <span 
class="input-group-addon"><span class="badge count"></span></span> 
                                        </div>
                                        <div class="exampleTable">
                                                <table class="table">
diff --git a/wikibase/queryService/ui/QueryExampleDialog.js 
b/wikibase/queryService/ui/QueryExampleDialog.js
index 8a4022c..8c945aa 100644
--- a/wikibase/queryService/ui/QueryExampleDialog.js
+++ b/wikibase/queryService/ui/QueryExampleDialog.js
@@ -104,6 +104,7 @@
                this._querySamplesApi.getExamples().done( function( examples ) {
                        self._examples = examples;
                        self._initTagCloud();
+                       self._updateExamplesCount( examples.length );
 
                        $.each( examples, function( key, example ) {
                                if ( example.category !==  category ) {
@@ -309,6 +310,14 @@
                $matchingElements.each( function( i, el ) {
                        $( el ).prevAll( 'tr.active' ).first().show();
                } );
+               this._updateExamplesCount( $matchingElements.length );
+       };
+
+       /**
+        * @private
+        */
+       SELF.prototype._updateExamplesCount = function( count ) {
+               this._$element.find( '.count' ).text( count );
        };
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/312233
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c93974a8f2f1c7226652973d8b6487ec921778a
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to