Merge "Add setTitle function to assign hint message."

This commit is contained in:
viktard
2018-06-19 22:59:55 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 0 deletions

View File

@@ -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);

View File

@@ -143,10 +143,12 @@ breaking changes to gr-change-actions wont 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');