jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Smalyshev: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/index.html b/index.html
index ba3b9f4..08ad851 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: merged
Gerrit-Change-Id: I2c93974a8f2f1c7226652973d8b6487ec921778a
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: Thiemo M├Ąttig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: WMDE-leszek <leszek.mani...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to