Skip to content

Commit b164077

Browse files
authored
Merge pull request #451 from matestack/20200824_use-html-attributes-and-properties-everywhere
Use html attributes and properties implementation everywhere
2 parents 92829a6 + 0d0651d commit b164077

File tree

220 files changed

+482
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+482
-692
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion

app/concepts/matestack/ui/core/abbr/abbr.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%abbr{@tag_attributes}
1+
%abbr{ html_attributes }
22
- if text.blank? && block_given?
33
= yield
44
- else
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
module Matestack::Ui::Core::Abbr
22
class Abbr < Matestack::Ui::Core::Component::Static
3-
requires :title
43
optional :text
5-
6-
def setup
7-
@tag_attributes.merge!({
8-
"title": title
9-
})
10-
end
11-
124
end
135
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
%a{@tag_attributes, "@click.prevent": "perform", "href": action_path}
1+
%a{ html_attributes, "@click.prevent": "perform", "href": action_path }
22
- if block_given?
33
= yield
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%component{dynamic_tag_attributes}
1+
%component{ dynamic_tag_attributes }
22
%div
3-
%div{"v-if": "asyncTemplate == null"}
3+
%div{ "v-if": "asyncTemplate == null" }
44
= render_content
5-
%div{"v-if": "asyncTemplate != null"}
6-
%v-runtime-template{":template":"asyncTemplate"}
5+
%div{ "v-if": "asyncTemplate != null" }
6+
%v-runtime-template{ ":template":"asyncTemplate" }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
%address{@tag_attributes}
2-
- if text.nil? && block_given?
1+
%address{ html_attributes }
2+
- if text.blank? && block_given?
33
= yield
44
- else
55
= text
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
%area{@tag_attributes}
1+
%area{ html_attributes, "coords": coords.join(',') }
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
module Matestack::Ui::Core::Area
22
class Area < Matestack::Ui::Core::Component::Static
3-
optional :alt, :coords, :download, :href, :hreflang, :media, :rel, :shape, :target, :type
4-
5-
def setup
6-
@tag_attributes.merge!({
7-
alt: alt,
8-
coords: coords.join(','),
9-
download: download,
10-
href: href,
11-
hreflang: hreflang,
12-
media: media,
13-
rel: rel,
14-
shape: shape,
15-
target: target,
16-
type: type
17-
})
18-
end
3+
html_attributes :alt, :download, :href, :hreflang, :media, :rel, :shape, :target, :type
4+
optional :coords
195
end
206
end
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
%article{@tag_attributes}
2-
- if options[:text].nil? && block_given?
1+
%article{ html_attributes }
2+
- if text.nil? && block_given?
33
= yield
44
- else
5-
= options[:text]
5+
= text
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Matestack::Ui::Core::Article
22
class Article < Matestack::Ui::Core::Component::Static
3-
3+
optional :text
44
end
55
end

0 commit comments

Comments
 (0)