mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Reimplement menu onclick functionality that appears to have been dropped (probably a bad merge?) in the webpack PR.
This commit is contained in:
@@ -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
Reference in New Issue
Block a user