Changeset 19893
- Timestamp:
- 02/09/2012 09:40:46 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/theme.dev.js
r19887 r19893 67 67 68 68 init : function() { 69 $( '.pagination-links').hide();69 $('.pagination-links').hide(); 70 70 71 71 inputs.nonce = $('#_ajax_fetch_list_nonce').val(); … … 78 78 inputs.search = inputs.queryArray['s']; 79 79 inputs.features = inputs.queryArray['features']; 80 inputs.startPage = parseInt( inputs.queryArray['paged'] ); 80 inputs.startPage = parseInt( inputs.queryArray['paged'] ); 81 81 inputs.tab = inputs.queryArray['tab']; 82 82 inputs.type = inputs.queryArray['type']; … … 87 87 inputs.startPage++; 88 88 89 // FIXME: Debug Features Array 90 // console.log("Features:" + inputs.features); 91 92 // Link to output and start polling 89 // Cache jQuery objects 93 90 inputs.outList = $('#availablethemes'); 91 inputs.waiting = $('div.tablenav.bottom').children( 'img.ajax-loading' ); 92 inputs.window = $(window); 94 93 95 94 // Generate Query … … 97 96 98 97 // Start Polling 99 $(window).scroll( function(){ wpThemes.maybeLoad(); });98 inputs.window.scroll( function(){ wpThemes.maybeLoad(); } ); 100 99 }, 101 100 delayedCallback : function( func, delay ) { … … 138 137 this.noMoreResults = true; 139 138 } else { 140 inputs.outList.append( results.rows);139 inputs.outList.append( results.rows ); 141 140 } 142 141 }, … … 144 143 var self = this, 145 144 el = $(document), 146 bottom = el.scrollTop() + $(window).innerHeight(); 147 148 /* // FIXME: Debug scroll trigger. 149 console.log('scrollTop:'+ el.scrollTop() + 150 '; scrollBottom:' + bottom + 151 '; height:' + el.height() + 152 '; checkVal:' + (el.height() - wpThemes.outListBottomThreshold)); 153 */ 154 145 bottom = el.scrollTop() + inputs.window.innerHeight(); 146 155 147 if ( this.noMoreResults || 156 148 !this.query.ready() || … … 160 152 setTimeout( function() { 161 153 var newTop = el.scrollTop(), 162 newBottom = newTop + $(window).innerHeight();154 newBottom = newTop + inputs.window.innerHeight(); 163 155 164 156 if ( !self.query.ready() || … … 166 158 return; 167 159 168 /* FIXME: Create/Add Spinner. 169 self.waiting.show(); // Show Spinner 170 el.scrollTop( newTop + self.waiting.outerHeight() ); // Scroll down? 171 self.ajax( function() { self.waiting.hide(); }); // Hide Spinner 172 */ 173 self.ajax(); 160 inputs.waiting.css( 'visibility', 'visible' ); // Show Spinner 161 self.ajax( function() { inputs.waiting.css( 'visibility', 'hidden' ) } ); // Hide Spinner 162 174 163 }, wpThemes.timeToTriggerQuery ); 175 164 }, … … 214 203 query = { 215 204 action: 'fetch-list', 205 tab: inputs.tab, 216 206 paged: this.page, 217 207 s: inputs.search, 208 type: inputs.type, 209 _ajax_fetch_list_nonce: inputs.nonce, 218 210 'features[]': inputs.features, 219 'list_args': list_args, 220 'tab': inputs.tab, 221 'type': inputs.type, 222 '_ajax_fetch_list_nonce': inputs.nonce 211 'list_args': list_args 223 212 }; 224 213
Note: See TracChangeset
for help on using the changeset viewer.