Skip to content

Commit adaae6d

Browse files
authored
Merge pull request #738 from lookbook-hq/fix-params-panel-unresponsive-bug
Fix unresponsive params panel bug
2 parents 187ddb9 + adcb099 commit adaae6d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/controllers/lookbook/application_controller.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class ApplicationController < ActionController::Base
1010
helper Lookbook::ApplicationHelper
1111
helper Lookbook::UiElementsHelper
1212

13+
before_action :disable_annotations
14+
after_action :restore_annotations
15+
1316
before_action :assign_theme_overrides
1417
before_action :assign_instance_vars
1518

@@ -37,6 +40,20 @@ def not_found
3740

3841
protected
3942

43+
def disable_annotations
44+
return unless ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames)
45+
46+
@original_annotations_value = ActionView::Base.annotate_rendered_view_with_filenames
47+
ActionView::Base.annotate_rendered_view_with_filenames = false
48+
end
49+
50+
def restore_annotations
51+
return if @original_annotations_value.nil?
52+
53+
ActionView::Base.annotate_rendered_view_with_filenames = @original_annotations_value
54+
@original_annotations_value = nil
55+
end
56+
4057
def assign_theme_overrides
4158
@theme_overrides ||= Engine.theme.to_css
4259
end

0 commit comments

Comments
 (0)