mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
CategoryPopupWidget: Track popup hiding again so sortkey changes are applied
OOjs UI killed the 'hide' event that was running this code in the dialog refactor back in July (Id121fc3a), but left it documented (along with 'show'). Just use the 'toggle' event instead. Bug: 72168 Change-Id: I172fac81c4cbb89505522011aed57db57ccbc52f
This commit is contained in:
parent
bc76c6ea3e
commit
d7a5f4c1ac
|
@ -43,7 +43,7 @@ ve.ui.MWCategoryPopupWidget = function VeUiMWCategoryPopupWidget( config ) {
|
|||
.append( this.sortKeyField.$element );
|
||||
|
||||
// Events
|
||||
this.connect( this, { hide: 'onHide' } );
|
||||
this.connect( this, { toggle: 'onToggle' } );
|
||||
this.removeButton.connect( this, { click: 'onRemoveCategory' } );
|
||||
this.$sortKeyForm.on( 'submit', this.onSortKeySubmit.bind( this ) );
|
||||
|
||||
|
@ -122,11 +122,15 @@ ve.ui.MWCategoryPopupWidget.prototype.openPopup = function ( item ) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Handle popup hide events.
|
||||
* Handle popup toggle events.
|
||||
*
|
||||
* @param {boolean} show Widget is being made visible
|
||||
* @method
|
||||
*/
|
||||
ve.ui.MWCategoryPopupWidget.prototype.onHide = function () {
|
||||
ve.ui.MWCategoryPopupWidget.prototype.onToggle = function ( show ) {
|
||||
if ( show ) {
|
||||
return;
|
||||
}
|
||||
var newSortkey = this.sortKeyInput.$input.val();
|
||||
if ( !this.removed && newSortkey !== ( this.origSortkey || '' ) ) {
|
||||
this.emit( 'updateSortkey', this.category, this.sortKeyInput.$input.val() );
|
||||
|
|
Loading…
Reference in a new issue