mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Introducing getTitle() in MWTitleInputWidget
A method for getTitle() is added which can return the valid title, or, it can return null, in case the value isn't a valid title Bug: 72468 Change-Id: I8a13afc9a66c167fe25010743c0d9e1424133d96
This commit is contained in:
parent
b4e98c1490
commit
9191465039
|
@ -125,3 +125,15 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
|
|||
|
||||
return items;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get template title
|
||||
*
|
||||
* @returns {mw.Title|null} Template title if valid or null
|
||||
*/
|
||||
ve.ui.MWTitleInputWidget.prototype.getTitle = function () {
|
||||
var title = this.getValue(),
|
||||
titleObj = mw.Title.newFromText( title );
|
||||
|
||||
return titleObj;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue