Ricordisamoa has uploaded a new change for review.

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

Change subject: TextInputWidget: Use getValidity in demos
......................................................................

TextInputWidget: Use getValidity in demos

Instead of the deprecated isValid method.

Change-Id: Iaf73379a2d7bdc62306290ba5b19144ab405b9ee
---
M demos/pages/widgets.js
1 file changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/01/280801/1

diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 2820c58..165b298 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -116,16 +116,14 @@
                        deferred = $.Deferred(),
                        delay = 500 + Math.floor( Math.random() * 500 );
 
-               this.isValid().done( function ( valid ) {
-                       if ( valid ) {
-                               // Resolve with results after a faked delay
-                               setTimeout( function () {
-                                       deferred.resolve( [ value * 1, value * 
2, value * 3, value * 4, value * 5 ] );
-                               }, delay );
-                       } else {
-                               // No results when the input contains invalid 
content
-                               deferred.resolve( [] );
-                       }
+               this.getValidity().then( function () {
+                       // Resolve with results after a faked delay
+                       setTimeout( function () {
+                               deferred.resolve( [ value * 1, value * 2, value 
* 3, value * 4, value * 5 ] );
+                       }, delay );
+               }, function () {
+                       // No results when the input contains invalid content
+                       deferred.resolve( [] );
                } );
 
                return deferred.promise( { abort: function () {} } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf73379a2d7bdc62306290ba5b19144ab405b9ee
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to