From 9d3eea5fdf248bdf27dc201cf2cd9c2aa038252f Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 21 Sep 2020 20:38:40 +0100 Subject: [PATCH] Only reset summaryPrefixLength on user event Bug: T263062 Change-Id: I323ce4dab0a430e2aeb906ae9cd5d6b48a179cff --- modules/dt.ui.ReplyWidget.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/dt.ui.ReplyWidget.js b/modules/dt.ui.ReplyWidget.js index bfd64cf83..cdb8ad3a5 100644 --- a/modules/dt.ui.ReplyWidget.js +++ b/modules/dt.ui.ReplyWidget.js @@ -299,16 +299,20 @@ ReplyWidget.prototype.toggleAdvanced = function ( showAdvanced ) { } else { this.focus(); } - this.onEditSummaryChange(); + this.storeEditSummary(); this.storage.set( this.storagePrefix + '/showAdvanced', this.showAdvanced ? '1' : '' ); }; ReplyWidget.prototype.onEditSummaryChange = function () { - this.storage.set( this.storagePrefix + '/summary', this.getEditSummary() ); + this.storeEditSummary(); // After first subsequent edit, reset this so auto-select no longer happens this.summaryPrefixLength = null; }; +ReplyWidget.prototype.storeEditSummary = function () { + this.storage.set( this.storagePrefix + '/summary', this.getEditSummary() ); +}; + ReplyWidget.prototype.getEditSummary = function () { return this.editSummaryInput.getValue(); };