-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dashboard - fullscreen - open in new tab #2920
Conversation
This makes the "Full Screen" button in Dashboard widgets open the fullscreen version in a new window/tab.
There was already support for diff --git a/app/assets/javascripts/components/dropdown-menu.js b/app/assets/javascripts/components/dropdown-menu.js
index 3e8aa2474e..655fccc43e 100644
--- a/app/assets/javascripts/components/dropdown-menu.js
+++ b/app/assets/javascripts/components/dropdown-menu.js
@@ -11,6 +11,15 @@ ManageIQ.angular.app.component('dropdownMenu', {
vm.dropdown_id = 'btn_' + vm.id;
vm.buttons = JSON.parse(vm.buttonsData);
};
+
+ this.customAction = function($event, action) {
+ if (!action) {
+ return;
+ }
+
+ (new Function(action)).call($event.target);
+ $event.preventDefault();
+ };
},
templateUrl: "/static/dropdown-menu.html.haml",
});
diff --git a/app/views/static/dropdown-menu.html.haml b/app/views/static/dropdown-menu.html.haml
index 621000be0f..571ba5d86a 100644
--- a/app/views/static/dropdown-menu.html.haml
+++ b/app/views/static/dropdown-menu.html.haml
@@ -15,6 +15,7 @@
'ng-attr-data-remote' => "{{button.dataRemote}}",
'data-confirm' => "{{button.confirm}}",
'href' => "{{button.href}}",
- 'data-miq_sparkle_on' => "{{button.sparkleOn ? 'true' : 'false'}}"}
+ 'data-miq_sparkle_on' => "{{button.sparkleOn ? 'true' : 'false'}}",
+ 'ng-click' => "vm.customAction($event, button.clickAction)"}
%span{'ng-class' => "button.fonticon"}
{{button.name}} .. and the we hit the problem that the function does not read Seems cleaner to drop the |
Checked commit https://github.com/himdel/manageiq-ui-classic/commit/ae76b7d038904d82166dc164aa99a339aa289da1 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 app/presenters/widget_presenter.rb
|
looks good. |
Dashboard - fullscreen - open in new tab (cherry picked from commit a5bb860)
Gaprindashvili backport details:
|
This makes the "Full Screen" button in Dashboard widgets open the fullscreen version in a new window/tab.
Cc @martinpovolny, @ZitaNemeckova