mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-04 04:48:36 +00:00
Merge "UsernameCompletionAction: Tell widget to remove characters when using insertAndOpen"
This commit is contained in:
commit
ebe98427be
|
@ -60,6 +60,7 @@ function MWUsernameCompletionAction() {
|
||||||
this.localUsers.sort( sortAuthors );
|
this.localUsers.sort( sortAuthors );
|
||||||
}
|
}
|
||||||
this.remoteUsers = [];
|
this.remoteUsers = [];
|
||||||
|
this.sequenceAdded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inheritance */
|
/* Inheritance */
|
||||||
|
@ -102,9 +103,19 @@ MWUsernameCompletionAction.prototype.insertAndOpen = function () {
|
||||||
}
|
}
|
||||||
fragment.collapseToEnd().select();
|
fragment.collapseToEnd().select();
|
||||||
|
|
||||||
|
this.sequenceAdded = true;
|
||||||
|
|
||||||
return this.open();
|
return this.open();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MWUsernameCompletionAction.prototype.getSequenceLength = function () {
|
||||||
|
if ( this.sequenceAdded ) {
|
||||||
|
return this.constructor.static.sequenceLength;
|
||||||
|
}
|
||||||
|
// Parent method
|
||||||
|
return MWUsernameCompletionAction.super.prototype.getSequenceLength.apply( this, arguments );
|
||||||
|
};
|
||||||
|
|
||||||
MWUsernameCompletionAction.prototype.getSuggestions = function ( input ) {
|
MWUsernameCompletionAction.prototype.getSuggestions = function ( input ) {
|
||||||
var title = mw.Title.makeTitle( mw.config.get( 'wgNamespaceIds' ).user, input ),
|
var title = mw.Title.makeTitle( mw.config.get( 'wgNamespaceIds' ).user, input ),
|
||||||
validatedInput = title ? input : '',
|
validatedInput = title ? input : '',
|
||||||
|
|
Loading…
Reference in a new issue