Better JavaScript handling for return method
authorCblair91 <admin@betadev.co.uk>
Sat, 30 Apr 2016 10:32:25 +0000 (10:32 +0000)
committerJdlrobson <jrobson@wikimedia.org>
Wed, 11 May 2016 23:49:05 +0000 (23:49 +0000)
The length selector can be reduced to just find the child of $tbody, as it will check to see if both $tbody and the child .collapsible exist.

Change-Id: If927a5ca79d12f4654a1af9bad97c9274cb501e9

resources/src/mediawiki.action/mediawiki.action.view.metadata.js

index b1a63b0..4c75e33 100644 (file)
@@ -14,7 +14,7 @@
                        $table = $( '#mw_metadata' ),
                        $tbody = $table.find( 'tbody' );
 
-               if ( !$tbody.length || !$tbody.find( '.collapsable' ).length ) {
+               if ( !$tbody.find( '.collapsable' ).length ) {
                        return;
                }