mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Collapse advanced drawer when clearing
Bug: T263061 Change-Id: Ibcd95ce1c86548962b9b7ff7b62bd0d127f53b76
This commit is contained in:
parent
e91f466115
commit
e6b91ced43
|
@ -243,11 +243,19 @@ ReplyWidget.prototype.isEmpty = null;
|
|||
|
||||
ReplyWidget.prototype.getMode = null;
|
||||
|
||||
/**
|
||||
* Restore the widget to its original state
|
||||
*
|
||||
* Clear any widget values, reset UI states, and clear
|
||||
* any auto-save values.
|
||||
*/
|
||||
ReplyWidget.prototype.clear = function () {
|
||||
if ( this.errorMessage ) {
|
||||
this.errorMessage.$element.remove();
|
||||
}
|
||||
this.$preview.empty();
|
||||
this.toggleAdvanced( false );
|
||||
|
||||
this.storage.remove( this.storagePrefix + '/mode' );
|
||||
this.storage.remove( this.storagePrefix + '/saveable' );
|
||||
this.storage.remove( this.storagePrefix + '/summary' );
|
||||
|
|
|
@ -126,8 +126,11 @@ ReplyWidgetVisual.prototype.teardown = function () {
|
|||
ReplyWidgetVisual.prototype.focus = function () {
|
||||
var targetWidget = this.replyBodyWidget;
|
||||
setTimeout( function () {
|
||||
targetWidget.getSurface().getModel().selectLastContentOffset();
|
||||
targetWidget.focus();
|
||||
// Check surface still exists after timeout
|
||||
if ( targetWidget.getSurface() ) {
|
||||
targetWidget.getSurface().getModel().selectLastContentOffset();
|
||||
targetWidget.focus();
|
||||
}
|
||||
} );
|
||||
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue