ONOS-3741: Dialog Service - allow alternate text to be specified with addOk() and addCancel().
Change-Id: I74b76d59c70e6d299e7cecd19f43dbb86d1ae6ac
diff --git a/web/gui/src/main/webapp/app/fw/layer/dialog.js b/web/gui/src/main/webapp/app/fw/layer/dialog.js
index e19280d..f674c8b 100644
--- a/web/gui/src/main/webapp/app/fw/layer/dialog.js
+++ b/web/gui/src/main/webapp/app/fw/layer/dialog.js
@@ -96,7 +96,7 @@
};
}
- function makeButton(text, callback, keyName) {
+ function makeButton(callback, text, keyName) {
var cb = fs.isF(callback),
key = fs.isS(keyName);
@@ -129,19 +129,19 @@
return dApi;
}
- function addButton(text, cb, key) {
+ function addButton(cb, text, key) {
if (pApi) {
- pApi.appendFooter(makeButton(text, cb, key));
+ pApi.appendFooter(makeButton(cb, text, key));
}
return dApi;
}
- function addOk(cb) {
- return addButton('OK', cb, 'enter');
+ function addOk(cb, text) {
+ return addButton(cb, text || 'OK', 'enter');
}
- function addCancel(cb) {
- return addButton('Cancel', cb, 'esc');
+ function addCancel(cb, text) {
+ return addButton(cb, text || 'Cancel', 'esc');
}
function clearBindings() {