Switch button key for revert submission for adding loading text
* After removing revert submission button, when key is revert_submission the text for the Revert button should update to loading Change-Id: Id28968faf03cb015abd6417915ea4a895f37ed0c
This commit is contained in:
@@ -1224,10 +1224,18 @@
|
|||||||
|
|
||||||
_setLoadingOnButtonWithKey(type, key) {
|
_setLoadingOnButtonWithKey(type, key) {
|
||||||
this._actionLoadingMessage = this._computeLoadingLabel(key);
|
this._actionLoadingMessage = this._computeLoadingLabel(key);
|
||||||
|
let buttonKey = key;
|
||||||
|
// TODO(dhruvsri): clean this up later
|
||||||
|
// If key is revert-submission, then button key should be 'revert'
|
||||||
|
if (buttonKey === ChangeActions.REVERT_SUBMISSION) {
|
||||||
|
// Revert submission button no longer exists
|
||||||
|
buttonKey = ChangeActions.REVERT;
|
||||||
|
}
|
||||||
|
|
||||||
// If the action appears in the overflow menu.
|
// If the action appears in the overflow menu.
|
||||||
if (this._getActionOverflowIndex(type, key) !== -1) {
|
if (this._getActionOverflowIndex(type, buttonKey) !== -1) {
|
||||||
this.push('_disabledMenuActions', key === '/' ? 'delete' : key);
|
this.push('_disabledMenuActions', buttonKey === '/' ? 'delete' :
|
||||||
|
buttonKey);
|
||||||
return function() {
|
return function() {
|
||||||
this._actionLoadingMessage = '';
|
this._actionLoadingMessage = '';
|
||||||
this._disabledMenuActions = [];
|
this._disabledMenuActions = [];
|
||||||
@@ -1235,7 +1243,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise it's a top-level action.
|
// Otherwise it's a top-level action.
|
||||||
const buttonEl = this.$$(`[data-action-key="${key}"]`);
|
const buttonEl = this.$$(`[data-action-key="${buttonKey}"]`);
|
||||||
buttonEl.setAttribute('loading', true);
|
buttonEl.setAttribute('loading', true);
|
||||||
buttonEl.disabled = true;
|
buttonEl.disabled = true;
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user