Commit 1e7e3882 by David Baumgold

Shorten secondary action detection code

parent 5a06c692
...@@ -66,11 +66,9 @@ CMS.Views.Alert = Backbone.View.extend({ ...@@ -66,11 +66,9 @@ CMS.Views.Alert = Backbone.View.extend({
var secondaryList = actions.secondary; var secondaryList = actions.secondary;
if(!secondaryList) { return; } if(!secondaryList) { return; }
// which secondary action was clicked? // which secondary action was clicked?
var i; var i = 0; // default to the first secondary action (easier for testing)
if(e && e.target) { if(e && e.target) {
i = _.indexOf(this.$(".action-secondary"), e.target); i = _.indexOf(this.$(".action-secondary"), e.target);
} else {
i = 0;
} }
var secondary = this.model.get("actions").secondary[i]; var secondary = this.model.get("actions").secondary[i];
if(secondary.click) { if(secondary.click) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment