From 754687c21c686b245e2e979135e2456d77f89f1a Mon Sep 17 00:00:00 2001 From: farhangithub27 Date: Tue, 21 Jan 2020 10:39:13 +1100 Subject: [PATCH] Progress bar color with reflect the notification type (info,success, warning, danger) with any type of notification theme. for example pastel-notify theme mentioned on http://bootstrap-notify.remabledesigns.com/ --- .vscode/settings.json | 5 +++++ bootstrap-notify.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5e36a8b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "workbench.colorCustomizations": { + "tab.unfocusedActiveBorder": "#fff0" + } +} \ No newline at end of file diff --git a/bootstrap-notify.js b/bootstrap-notify.js index d97e4c0..0a7c045 100644 --- a/bootstrap-notify.js +++ b/bootstrap-notify.js @@ -154,7 +154,9 @@ this.$ele.removeClass('alert-' + self.settings.type); this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type); self.settings.type = commands[cmd]; - this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]); + var regex = /\w[^-]*$/; + var notify_type = self.settings.type.match(regex); + this.$ele.addClass('alert-' + commands[command]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + notify_type); break; case "icon": var $icon = this.$ele.find('[data-notify="icon"]');