Sha256: 7ae4e827329d801333f786a9b85decd3461bd70f35e1449842068348a274023c
Contents?: true
Size: 868 Bytes
Versions: 14
Compression:
Stored size: 868 Bytes
Contents
module Locomotive module Liquid module Tags class InheritedBlock < ::Liquid::InheritedBlock def end_tag super if !self.contains_super?(@nodelist) # then disable all editable_elements coming from the parent block too and not used @context[:page].disable_parent_editable_elements(@name) end end protected def contains_super?(nodelist) nodelist.any? do |node| if node.is_a?(::Liquid::Variable) && node.name == 'block.super' true elsif node.respond_to?(:nodelist) && !node.nodelist.nil? && !node.is_a?(Locomotive::Liquid::Tags::InheritedBlock) contains_super?(node.nodelist) end end end end ::Liquid::Template.register_tag('block', InheritedBlock) end end end
Version data entries
14 entries across 14 versions & 1 rubygems