wpLink: fix spinners selectors and add some throttling when searching with AJAX while the user is typing, fixes #27615
git-svn-id: https://develop.svn.wordpress.org/trunk@27900 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c5f7f95979
commit
c28fff3b65
@ -1212,6 +1212,7 @@ i.mce-i-hr:before {
|
|||||||
#wp-link .river-waiting .spinner {
|
#wp-link .river-waiting .spinner {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: block;
|
display: block;
|
||||||
|
float: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wp-link .submitbox {
|
#wp-link .submitbox {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
var wpLink;
|
var wpLink;
|
||||||
|
|
||||||
( function( $ ) {
|
( function( $ ) {
|
||||||
var inputs = {}, rivers = {}, editor, River, Query;
|
var inputs = {}, rivers = {}, editor, searchTimer, River, Query;
|
||||||
|
|
||||||
wpLink = {
|
wpLink = {
|
||||||
timeToTriggerRiver: 150,
|
timeToTriggerRiver: 150,
|
||||||
@ -47,7 +47,14 @@ var wpLink;
|
|||||||
|
|
||||||
rivers.elements.on( 'river-select', wpLink.updateFields );
|
rivers.elements.on( 'river-select', wpLink.updateFields );
|
||||||
|
|
||||||
inputs.search.keyup( wpLink.searchInternalLinks );
|
inputs.search.keyup( function() {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
window.clearTimeout( searchTimer );
|
||||||
|
searchTimer = window.setTimeout( function() {
|
||||||
|
wpLink.searchInternalLinks.call( self );
|
||||||
|
}, 500 );
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
open: function( editorId ) {
|
open: function( editorId ) {
|
||||||
@ -283,7 +290,7 @@ var wpLink;
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wpLink.lastSearch = search;
|
wpLink.lastSearch = search;
|
||||||
waiting = $( '#river-waiting' ).show();
|
waiting = t.parent().find('.spinner').show();
|
||||||
|
|
||||||
rivers.search.change( search );
|
rivers.search.change( search );
|
||||||
rivers.search.ajax( function() {
|
rivers.search.ajax( function() {
|
||||||
@ -381,7 +388,7 @@ var wpLink;
|
|||||||
this.element = element;
|
this.element = element;
|
||||||
this.ul = element.children( 'ul' );
|
this.ul = element.children( 'ul' );
|
||||||
this.contentHeight = element.children( '#link-selector-height' );
|
this.contentHeight = element.children( '#link-selector-height' );
|
||||||
this.waiting = $( '#river-waiting' );
|
this.waiting = element.find('.river-waiting');
|
||||||
|
|
||||||
this.change( search );
|
this.change( search );
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user