Reimplement menu onclick functionality that appears to have been dropped (probably a bad merge?) in the webpack PR.

This commit is contained in:
Dannon Baker
2015-12-17 19:35:17 -05:00
parent 455372e6bf
commit 04f5ed4552
6 changed files with 40 additions and 30 deletions
+20 -10
View File
@@ -388,7 +388,8 @@ var GalaxyMastheadTab = Backbone.View.extend({
type : 'url',
target : '_parent',
scratchbook : false,
divider : false
divider : false,
onclick : undefined
}
// read in defaults
@@ -419,17 +420,26 @@ var GalaxyMastheadTab = Backbone.View.extend({
// add events
var self = this;
$item.on('click', function(e){
// prevent default
e.preventDefault();
// no modifications if new tab is requested
if (self.options.target === '_blank')
return true;
// load into frame
Galaxy.frame.add(options);
});
if (menuOptions.onclick !== undefined){
$item.on('click', function(e){
e.preventDefault();
menuOptions.onclick();
});
} else {
$item.on('click', function(e){
// prevent default
e.preventDefault();
// no modifications if new tab is requested
if (self.options.target === '_blank')
return true;
// load into frame
Galaxy.frame.add(options);
});
}
// append divider
if (menuOptions.divider)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long