WordPress.org

Make WordPress Core

Changeset 16554


Ignore:
Timestamp:
11/23/10 20:20:44 (3 years ago)
Author:
scribu
Message:

Make filter_count() a closure. See #14936

Location:
trunk/wp-admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/theme.dev.js

    r16553 r16554  
    33(function($){ 
    44    ThemeViewer = function( args ) { 
    5  
    6         function filter_count() { 
    7             var count = $( '#filter-box :checked' ).length; 
    8             var text  = $( '#filter-click' ).text(); 
    9  
    10             if ( text.indexOf( '(' ) != -1 ) 
    11                 text = text.substr( 0, text.indexOf( '(' ) ); 
    12  
    13             if ( count == 0 ) 
    14                 $( '#filter-click' ).text( text ); 
    15             else 
    16                 $( '#filter-click' ).text( text + ' (' + count + ')' ); 
    17         } 
    185 
    196        function init() { 
     
    2613 
    2714            $( '#filter-box :checkbox' ).unbind( 'click' ).click( function() { 
    28                 filter_count(); 
     15                var count = $( '#filter-box :checked' ).length, 
     16                    text  = $( '#filter-click' ).text(); 
     17 
     18                if ( text.indexOf( '(' ) != -1 ) 
     19                    text = text.substr( 0, text.indexOf( '(' ) ); 
     20 
     21                if ( count == 0 ) 
     22                    $( '#filter-click' ).text( text ); 
     23                else 
     24                    $( '#filter-click' ).text( text + ' (' + count + ')' ); 
    2925            }); 
    3026 
  • trunk/wp-admin/js/theme.js

    r16553 r16554  
    1 var ThemeViewer;(function(a){ThemeViewer=function(b){function d(){var f=a("#filter-box :checked").length;var g=a("#filter-click").text();if(g.indexOf("(")!=-1){g=g.substr(0,g.indexOf("("))}if(f==0){a("#filter-click").text(g)}else{a("#filter-click").text(g+" ("+f+")")}}function e(){a("#filter-click, #mini-filter-click").unbind("click").click(function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300);return false});a("#filter-box :checkbox").unbind("click").click(function(){d()});a("#filter-box :submit").unbind("click").click(function(){var f=[];a("#filter-box :checked").each(function(){f.push(a(this).val())});listTable.update_rows({features:f},true,function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300)});return false})}var c={init:e};return c}})(jQuery);jQuery(document).ready(function(a){theme_viewer=new ThemeViewer();theme_viewer.init()}); 
     1var ThemeViewer;(function(a){ThemeViewer=function(b){function d(){a("#filter-click, #mini-filter-click").unbind("click").click(function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300);return false});a("#filter-box :checkbox").unbind("click").click(function(){var e=a("#filter-box :checked").length,f=a("#filter-click").text();if(f.indexOf("(")!=-1){f=f.substr(0,f.indexOf("("))}if(e==0){a("#filter-click").text(f)}else{a("#filter-click").text(f+" ("+e+")")}});a("#filter-box :submit").unbind("click").click(function(){var e=[];a("#filter-box :checked").each(function(){e.push(a(this).val())});listTable.update_rows({features:e},true,function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300)});return false})}var c={init:d};return c}})(jQuery);jQuery(document).ready(function(a){theme_viewer=new ThemeViewer();theme_viewer.init()}); 
Note: See TracChangeset for help on using the changeset viewer.