Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@
preventDuplicates: false,
progressBar: false,
progressClass: 'toast-progress',
rtl: false
rtl: false,
typeBasedOverrides: {}
};
}

Expand All @@ -201,8 +202,15 @@

function notify(map) {
var options = getOptions();

var iconClass = map.iconClass || options.iconClass;

// extend the options object with type specific overrides
if (typeof (options.typeBasedOverrides[map.type]) !== 'undefined') {
options = $.extend(options, options.typeBasedOverrides[map.type]);
iconClass = options.typeBasedOverrides[map.type].iconClass || iconClass;
}

if (typeof (map.optionsOverride) !== 'undefined') {
options = $.extend(options, map.optionsOverride);
iconClass = map.optionsOverride.iconClass || iconClass;
Expand Down