diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 00f35412ead..1ea9d157bb1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1552,10 +1552,13 @@ def title_for_cluster_record(record) end def miq_tab_header(id, active = nil, options = {}, &_block) - content_tag(:li, - :class => "#{options[:class]} #{active == id ? 'active' : ''}", - :id => "#{id}_tab", - 'ng-click' => "changeAuthTab('#{id}');") do + tag_options = {:class => "#{options[:class]} #{active == id ? 'active' : ''}", + :id => "#{id}_tab"} + + tag_options['ng-click'] = options['ng-click'] if options.key?('ng-click') + tag_options[:onclick] = options[:onclick] if options.key?(:onclick) + + content_tag(:li, tag_options) do content_tag(:a, :href => "##{id}", 'data-toggle' => 'tab') do yield end @@ -1563,8 +1566,9 @@ def miq_tab_header(id, active = nil, options = {}, &_block) end def miq_tab_content(id, active = nil, options = {}, &_block) - content_tag(:div, :id => id, :class => "tab-pane #{options[:class]} #{active == id ? 'active' : ''}") do - yield + lazy = options[:lazy] && active != id + content_tag(:div, :id => id, :class => "tab-pane #{options[:class]} #{active == id ? 'active' : ''} #{lazy ? 'lazy' : ''}") do + yield unless lazy end end diff --git a/app/views/layouts/_multi_auth_credentials.html.haml b/app/views/layouts/_multi_auth_credentials.html.haml index c1276b4444c..ddb1693eeb0 100644 --- a/app/views/layouts/_multi_auth_credentials.html.haml +++ b/app/views/layouts/_multi_auth_credentials.html.haml @@ -6,24 +6,24 @@ = legendtext #auth_tabs %ul.nav.nav-tabs - = miq_tab_header('default') do + = miq_tab_header('default', nil, {'ng-click' => "changeAuthTab('default')"}) do = _("Default") - if %w(ems_cloud ems_infra).include?(params[:controller]) - if @edit[:new][:emstype] == "rhevm" - = miq_tab_header('metrics') do + = miq_tab_header('metrics', nil, {'ng-click' => "changeAuthTab('metrics')"}) do = _("C & U Database") - if %w(openstack openstack_infra).include?(@edit[:new][:emstype]) - = miq_tab_header('amqp') do + = miq_tab_header('amqp', nil, {'ng-click' => "changeAuthTab('amqp')"}) do = _("AMQP") - if %w(openstack_infra).include?(@edit[:new][:emstype]) - = miq_tab_header('ssh_keypair') do + = miq_tab_header('ssh_keypair', nil, {'ng-click' => "changeAuthTab('ssh_keypair')"}) do = _("RSA key pair") - elsif !%w(ems_middleware).include?(params[:controller]) - = miq_tab_header('remote') do + = miq_tab_header('remote', nil, {'ng-click' => "changeAuthTab('remote')"}) do = _("Remote Login") - = miq_tab_header('web') do + = miq_tab_header('web', nil, {'ng-click' => "changeAuthTab('web')"}) do = _("Web Services") - = miq_tab_header('ipmi') do + = miq_tab_header('ipmi', nil, {'ng-click' => "changeAuthTab('ipmi')"}) do = _("IPMI") .tab-content