Sha256: 38226d548e89e2d44f073cfbb22de8a90e1b54f2a33649703ef83a63492a6488

Contents?: true

Size: 728 Bytes

Versions: 7

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

module Avo
  module Concerns
    module ControlsPlacement
      extend ActiveSupport::Concern

      def controls_placement_calculated
        @controls_placement_calculated ||= controls_placement || Avo.configuration.resource_controls_placement
      end

      def resource_controls_render_on_the_right?
        controls_placement_calculated == :right || resource_controls_render_on_both_sides?
      end

      def resource_controls_render_on_the_left?
        controls_placement_calculated == :left || resource_controls_render_on_both_sides?
      end

      private

      def resource_controls_render_on_both_sides?
        controls_placement_calculated == :both
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
avo-3.14.5 lib/avo/concerns/controls_placement.rb
avo-3.14.4 lib/avo/concerns/controls_placement.rb
avo-3.14.3 lib/avo/concerns/controls_placement.rb
avo-3.14.2 lib/avo/concerns/controls_placement.rb
avo-3.14.1 lib/avo/concerns/controls_placement.rb
avo-3.14.0 lib/avo/concerns/controls_placement.rb
avo-3.13.7 lib/avo/concerns/controls_placement.rb