Merge "Add setTitle function to assign hint message."
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user