Disable the change reply button until the server config has loaded
Because the reply dialog depends on the server config to know whether to display the CC list, await the config load before enabling the button. Bug: Issue 5244 Change-Id: Id2ebb86f54f398c7ab3a40f78774531770b31099
This commit is contained in:
@@ -268,6 +268,7 @@ limitations under the License.
|
|||||||
<gr-button
|
<gr-button
|
||||||
class="reply"
|
class="reply"
|
||||||
secondary
|
secondary
|
||||||
|
disabled="[[_replyDisabled]]"
|
||||||
on-tap="_handleReplyTap">[[_replyButtonLabel]]</gr-button>
|
on-tap="_handleReplyTap">[[_replyButtonLabel]]</gr-button>
|
||||||
<gr-change-actions id="actions"
|
<gr-change-actions id="actions"
|
||||||
change="[[_change]]"
|
change="[[_change]]"
|
||||||
|
|||||||
@@ -111,6 +111,11 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
computed: '_computeDescriptionReadOnly(_loggedIn, _change, _account)',
|
computed: '_computeDescriptionReadOnly(_loggedIn, _change, _account)',
|
||||||
},
|
},
|
||||||
|
_replyDisabled: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
computed: '_computeReplyDisabled(serverConfig)',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
behaviors: [
|
behaviors: [
|
||||||
@@ -919,5 +924,7 @@
|
|||||||
_computeDescriptionReadOnly: function(loggedIn, change, account) {
|
_computeDescriptionReadOnly: function(loggedIn, change, account) {
|
||||||
return !(loggedIn && (account._account_id === change.owner._account_id));
|
return !(loggedIn && (account._account_id === change.owner._account_id));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_computeReplyDisabled: function() { return false; }
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -781,5 +781,11 @@ limitations under the License.
|
|||||||
assert.equal(element.$.replyDialog.quote, '> quote text\n\n');
|
assert.equal(element.$.replyDialog.quote, '> quote text\n\n');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('reply button is disabled until server config is loaded', function() {
|
||||||
|
assert.isTrue(element._replyDisabled);
|
||||||
|
element.serverConfig = {};
|
||||||
|
assert.isFalse(element._replyDisabled);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ limitations under the License.
|
|||||||
:host([loading][disabled]) {
|
:host([loading][disabled]) {
|
||||||
cursor: wait;
|
cursor: wait;
|
||||||
}
|
}
|
||||||
:host(:focus:not([primary]):not([secondary])),
|
:host(:focus:not([primary]):not([secondary]):not([disabled])),
|
||||||
:host(:hover:not([primary]):not([secondary])) {
|
:host(:hover:not([primary]):not([secondary]):not([disabled])) {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border-color: #aaa;
|
border-color: #aaa;
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ limitations under the License.
|
|||||||
:host([primary]:focus) {
|
:host([primary]:focus) {
|
||||||
box-shadow: 0 0 1px #00f;
|
box-shadow: 0 0 1px #00f;
|
||||||
}
|
}
|
||||||
:host([primary]:hover) {
|
:host([primary]:not([disabled]):hover) {
|
||||||
background-color: #4d90fe;
|
background-color: #4d90fe;
|
||||||
border-color: #00F;
|
border-color: #00F;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ limitations under the License.
|
|||||||
:host([secondary]:focus) {
|
:host([secondary]:focus) {
|
||||||
box-shadow: 0 0 1px #f00;
|
box-shadow: 0 0 1px #f00;
|
||||||
}
|
}
|
||||||
:host([secondary]:hover) {
|
:host([secondary]:not([disabled]):hover) {
|
||||||
background-color: #c53727;
|
background-color: #c53727;
|
||||||
border: 1px solid #b0281a;
|
border: 1px solid #b0281a;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user