Skip to content

Commit

Permalink
Merge pull request #2796 from martinpovolny/sand_style
Browse files Browse the repository at this point in the history
GTLs: use ExplorerPresenter to fix styles in Services.
  • Loading branch information
h-kataria committed Nov 22, 2017
2 parents 93fcae5 + fd82d4c commit 23681d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/assets/javascripts/miq_explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ ManageIQ.explorer.focus = function(data) {
}
};

ManageIQ.explorer.removeSand = function() {
var mainContent = $('#main-content');
mainContent.removeClass('miq-sand-paper');
};

ManageIQ.explorer.processReplaceRightCell = function(data) {
/* variables for the expression editor */
if (_.isObject(data.expEditor)) {
Expand Down Expand Up @@ -292,6 +297,8 @@ ManageIQ.explorer.processReplaceRightCell = function(data) {
if (data.initAccords) { miqInitAccordions(); }
if (data.lockSidebar !== undefined) { ManageIQ.explorer.lockSidebar(data.lockSidebar); }

if (data.removeSand) { ManageIQ.explorer.removeSand(); }

if (_.isString(data.ajaxUrl)) {
miqAsyncAjax(data.ajaxUrl);
} else {
Expand Down
1 change: 1 addition & 0 deletions app/controllers/service_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def replace_right_cell(options = {})
elsif params[:display]
r[:partial => 'layouts/x_gtl', :locals => {:controller => "vm", :action_url => @lastaction}]
elsif record_showing
presenter.remove_sand
if action
partial_locals[:item_id] = @item.id
cb_tb = build_toolbar(Mixins::CustomButtons::Result.new(:single))
Expand Down
7 changes: 7 additions & 0 deletions app/presenters/explorer_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ def initialize(options = {})
:show_miq_buttons => false,
:load_chart => nil,
:open_window => nil,
:remove_sand => nil,
:rx => nil,
}.update(options)
end

def remove_sand
@options[:remove_sand] = true
self
end

def reset_changes
@options[:reset_changes] = true
self
Expand Down Expand Up @@ -296,6 +302,7 @@ def for_render_default
data[:lockSidebar] = !!@options[:lock_sidebar]
data[:chartData] = @options[:load_chart]
data[:resetChanges] = !!@options[:reset_changes]
data[:removeSand] = !!@options[:remove_sand]
data[:resetOneTrans] = !!@options[:reset_one_trans]
data[:oneTransIE] = !!@options[:one_trans_ie]
data[:focus] = @options[:focus]
Expand Down
2 changes: 1 addition & 1 deletion app/views/service/_svcs_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
%td
= h(s.name)
.row
.col-md-12.col-lg-6
.col-md-12
%h3
= _('VMs')
- if @view
Expand Down

0 comments on commit 23681d4

Please sign in to comment.