diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api.js b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api.js index 105e54300a..407a6a8b0c 100644 --- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api.js +++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api.js @@ -114,6 +114,11 @@ this._el.setActionButtonProp(key, 'label', text); }; + GrChangeActionsInterface.prototype.setTitle = function(key, text) { + ensureEl(this); + this._el.setActionButtonProp(key, 'title', text); + }; + GrChangeActionsInterface.prototype.setEnabled = function(key, enabled) { ensureEl(this); this._el.setActionButtonProp(key, 'enabled', enabled); diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api_test.html b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api_test.html index 988ed96f7e..fef4fc9df2 100644 --- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api_test.html +++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-change-actions-js-api_test.html @@ -143,10 +143,12 @@ breaking changes to gr-change-actions won’t be noticed. assert.equal(button.getAttribute('data-label'), 'Bork!'); assert.isNotOk(button.disabled); changeActions.setLabel(key, 'Yo'); + changeActions.setTitle(key, 'Yo hint'); changeActions.setEnabled(key, false); changeActions.setIcon(key, 'pupper'); flush(() => { assert.equal(button.getAttribute('data-label'), 'Yo'); + assert.equal(button.getAttribute('title'), 'Yo hint'); assert.isTrue(button.disabled); assert.equal(Polymer.dom(button).querySelector('iron-icon').icon, 'gr-icons:pupper');