diff --git a/src/os/ui/columnactions/abstractcolumnaction.js b/src/os/ui/columnactions/abstractcolumnaction.js index 6121fdb57..d34af6575 100644 --- a/src/os/ui/columnactions/abstractcolumnaction.js +++ b/src/os/ui/columnactions/abstractcolumnaction.js @@ -1,5 +1,4 @@ goog.provide('os.ui.columnactions.AbstractColumnAction'); -goog.require('goog.structs.Map'); diff --git a/src/os/ui/help/help.js b/src/os/ui/help/help.js index f6a504e6d..cda22d7f2 100644 --- a/src/os/ui/help/help.js +++ b/src/os/ui/help/help.js @@ -134,11 +134,11 @@ os.ui.help.HelpCtrl.prototype.initialize = function() { root.addChild({ eventType: os.ui.help.EventType.HELP_VIDEO, label: 'Help Videos', + link: videoUrl, tooltip: 'View help videos for ' + appName, icons: [''], sort: 20 }); - this.menu.listen(os.ui.help.EventType.HELP_VIDEO, this.onHelpAction_, false, this); } root.addChild({ @@ -172,13 +172,11 @@ os.ui.help.HelpCtrl.prototype.initialize = function() { root.addChild({ eventType: os.ui.help.EventType.VIDEO_CARD, label: 'Graphics Card Help', + link: videoCardUrl, tooltip: 'Troubleshoot 3D view', icons: [''], sort: 120 }); - this.menu.listen(os.ui.help.EventType.VIDEO_CARD, function() { - window.open(videoCardUrl); - }, false, this); } if (os.settings.get('onboarding') && os.settings.get('onboarding')['hideTips'] !== true) { @@ -247,10 +245,6 @@ os.ui.help.HelpCtrl.prototype.onHelpAction_ = function(event) { case os.ui.help.EventType.VIEW_ALERTS: this.scope.$emit(os.ui.help.EventType.VIEW_ALERTS); break; - case os.ui.help.EventType.HELP_VIDEO: - var videoUrl = /** @type {string} */ (os.settings.get('helpVideoUrl')); - window.open(videoUrl); - break; case os.ui.help.EventType.CONTROLS: os.ui.help.ControlsCtrl.launch(); break; diff --git a/src/os/ui/menu/menuitem.js b/src/os/ui/menu/menuitem.js index 7a39e3d38..fb53b72d6 100644 --- a/src/os/ui/menu/menuitem.js +++ b/src/os/ui/menu/menuitem.js @@ -31,11 +31,23 @@ os.ui.menu.UnclickableTypes = [ os.ui.menu.MenuItemType.SEPARATOR]; +/** + * @typedef {{ + * href: !string, + * target: (string|undefined), + * opener: (boolean|undefined), + * referrer: (boolean|undefined) + * }} + */ +os.ui.menu.MenuItemLink; + + /** * @typedef {{ * type: (os.ui.menu.MenuItemType|undefined), * eventType: (string|undefined), * label: (string|undefined), + * link: (string|os.ui.menu.MenuItemLink|undefined), * metricKey: (string|undefined), * visible: (boolean|undefined), * enabled: (boolean|undefined), @@ -71,6 +83,7 @@ os.ui.menu.MenuItem = function(options) { this.shortcut = options.shortcut; this.sort = options.sort || 0; this.closeOnSelect = options.closeOnSelect != null ? options.closeOnSelect : true; + this.link = options.link; /** * @type {Array>|undefined} @@ -275,6 +288,8 @@ os.ui.menu.MenuItem.prototype.render = function(context, opt_target) { // start wrapper div (required by jquery-ui 1.12+) html += '