ONOS-3741: Dialog Service - allow alternate text to be specified with addOk() and addCancel().
Change-Id: I74b76d59c70e6d299e7cecd19f43dbb86d1ae6ac
Showing
1 changed file
with
7 additions
and
7 deletions
... | @@ -96,7 +96,7 @@ | ... | @@ -96,7 +96,7 @@ |
96 | }; | 96 | }; |
97 | } | 97 | } |
98 | 98 | ||
99 | - function makeButton(text, callback, keyName) { | 99 | + function makeButton(callback, text, keyName) { |
100 | var cb = fs.isF(callback), | 100 | var cb = fs.isF(callback), |
101 | key = fs.isS(keyName); | 101 | key = fs.isS(keyName); |
102 | 102 | ||
... | @@ -129,19 +129,19 @@ | ... | @@ -129,19 +129,19 @@ |
129 | return dApi; | 129 | return dApi; |
130 | } | 130 | } |
131 | 131 | ||
132 | - function addButton(text, cb, key) { | 132 | + function addButton(cb, text, key) { |
133 | if (pApi) { | 133 | if (pApi) { |
134 | - pApi.appendFooter(makeButton(text, cb, key)); | 134 | + pApi.appendFooter(makeButton(cb, text, key)); |
135 | } | 135 | } |
136 | return dApi; | 136 | return dApi; |
137 | } | 137 | } |
138 | 138 | ||
139 | - function addOk(cb) { | 139 | + function addOk(cb, text) { |
140 | - return addButton('OK', cb, 'enter'); | 140 | + return addButton(cb, text || 'OK', 'enter'); |
141 | } | 141 | } |
142 | 142 | ||
143 | - function addCancel(cb) { | 143 | + function addCancel(cb, text) { |
144 | - return addButton('Cancel', cb, 'esc'); | 144 | + return addButton(cb, text || 'Cancel', 'esc'); |
145 | } | 145 | } |
146 | 146 | ||
147 | function clearBindings() { | 147 | function clearBindings() { | ... | ... |
-
Please register or login to post a comment