wpLink: fix spinners selectors and add some throttling when searching with AJAX while the user is typing, fixes #27615
Built from https://develop.svn.wordpress.org/trunk@27900 git-svn-id: http://core.svn.wordpress.org/trunk@27731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c7eb5e7f1f
commit
08770f6b88
|
@ -1212,6 +1212,7 @@ i.mce-i-hr:before {
|
|||
#wp-link .river-waiting .spinner {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#wp-link .submitbox {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1212,6 +1212,7 @@ i.mce-i-hr:before {
|
|||
#wp-link .river-waiting .spinner {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#wp-link .submitbox {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
|||
var wpLink;
|
||||
|
||||
( function( $ ) {
|
||||
var inputs = {}, rivers = {}, editor, River, Query;
|
||||
var inputs = {}, rivers = {}, editor, searchTimer, River, Query;
|
||||
|
||||
wpLink = {
|
||||
timeToTriggerRiver: 150,
|
||||
|
@ -47,7 +47,14 @@ var wpLink;
|
|||
|
||||
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 ) {
|
||||
|
@ -283,7 +290,7 @@ var wpLink;
|
|||
return;
|
||||
|
||||
wpLink.lastSearch = search;
|
||||
waiting = $( '#river-waiting' ).show();
|
||||
waiting = t.parent().find('.spinner').show();
|
||||
|
||||
rivers.search.change( search );
|
||||
rivers.search.ajax( function() {
|
||||
|
@ -381,7 +388,7 @@ var wpLink;
|
|||
this.element = element;
|
||||
this.ul = element.children( 'ul' );
|
||||
this.contentHeight = element.children( '#link-selector-height' );
|
||||
this.waiting = $( '#river-waiting' );
|
||||
this.waiting = element.find('.river-waiting');
|
||||
|
||||
this.change( search );
|
||||
this.refresh();
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue