Skip to content

Commit c8b05b6

Browse files
author
Dave Conway-Jones
committed
let dialog ok and cancel labels be settable
1 parent e31d5a4 commit c8b05b6

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
### 3.4.0-beta: Milestone Release
33

4-
- Add ability to specify to start page by tab name in url
4+
- Add ability to specify to start page by tab name in url
5+
- Let dialog popup ok and cancel labels be settable by msg.
56

67
### 3.3.1: Maintenance Release
78

dist/dashboard.appcache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# Time: Mon Jan 16 2023 15:11:39 GMT+0000 (Greenwich Mean Time)
2+
# Time: Mon Feb 13 2023 20:52:15 GMT+0000 (Greenwich Mean Time)
33

44
CACHE:
55
i18n.js
@@ -26,4 +26,4 @@ loading.html
2626
NETWORK:
2727
*
2828

29-
# hash: c5a3c8cc25c6fb29b99068967e00294027dd90a7920857e1df25e7d23d869eb5
29+
# hash: 3f3bfe63c90061130d51bf5e3b425c84773a5d84d8b83468730cbb9ad435118f

dist/js/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodes/locales/en-US/ui_toast.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
value of <code>msg.topic</code>.</p>
1111
<p>If you select 'OK, Cancel and Input' mode then <code>msg.payload</code> will contain
1212
any text input by the user, rather than the OK button text.</p>
13+
<p>The OK and Cancel button labels can be replaced by using <code>msg.ok</code> and <code>msg.cancel</code></p>
1314
<p>Sending a blank payload will remove any active dialog without sending any data.</p>
1415
<p>If a <b>Class</b> is specified, it will be added to the parent element. This way you can style the card and the elements inside it with custom CSS.</p>
1516
</script>

src/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,25 +617,25 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
617617
.htmlContent(msg.message)
618618
.initialValue("")
619619
.ariaLabel(msg.ok + " or " + msg.cancel)
620-
.ok(msg.ok)
621-
.cancel(msg.cancel);
620+
.ok(msg.msg.ok || msg.ok)
621+
.cancel(msg.msg.cancel || msg.cancel);
622622
confirm._options.focusOnOpen = false;
623623
}
624624
else if (msg.cancel) {
625625
confirm = $mdDialog.confirm()
626626
.title(msg.title)
627627
.htmlContent(msg.message)
628628
.ariaLabel(msg.ok + " or " + msg.cancel)
629-
.ok(msg.ok)
630-
.cancel(msg.cancel);
629+
.ok(msg.msg.ok || msg.ok)
630+
.cancel(msg.msg.cancel || msg.cancel);
631631
confirm._options.focusOnOpen = false;
632632
}
633633
else {
634634
confirm = $mdDialog.alert()
635635
.title(msg.title)
636636
.htmlContent(msg.message)
637637
.ariaLabel(msg.ok)
638-
.ok(msg.ok)
638+
.ok(msg.msg.ok || msg.ok)
639639
}
640640
confirm._options.template = '<md-dialog md-theme="{{ dialog.theme || dialog.defaultTheme }}" aria-label="{{ dialog.ariaLabel }}" class="' + msg.toastClass + ' >' +
641641
'<md-dialog-content class="md-dialog-content" role="document" tabIndex="-1">' +

0 commit comments

Comments
 (0)