Skip to content

Commit

Permalink
[#665] Add and use a modal component
Browse files Browse the repository at this point in the history
* takes care of including the close modal button and the bits of code
  needed to make reveal.js recognize this as a modal (the data-reveal)

* accepts id / class arguments

* tweaks the appearance of the close button so it's not as prominent

* some refactoring to make sure the styling is only done in one location
  • Loading branch information
afuna committed Sep 22, 2014
1 parent 49b0d1e commit 892c1bd
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
7 changes: 7 additions & 0 deletions htdocs/scss/components/foundation-custom/_reveal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.close-reveal-modal {
text-decoration: none;

&:hover, &:focus {
color: $primary-color;
}
}
4 changes: 3 additions & 1 deletion htdocs/scss/foundation/foundation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@
@import
"components/foundation-custom/buttons",
"components/foundation-custom/pagination",
"components/foundation-custom/tables";
"components/foundation-custom/tables",
"components/foundation-custom/reveal";

6 changes: 0 additions & 6 deletions htdocs/scss/skins/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ $nav-small-screen-header-height: 3em;
$top-offset:$reveal-position-top
);

.close-reveal-modal {
@include reveal-close(
$color:$reveal-close-color
);
}

.logout.button { display: block; margin-top: .5em; }
ul { list-style: none; margin-left: 0; }
}
Expand Down
1 change: 0 additions & 1 deletion htdocs/scss/skins/celerity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ $panel-bg: darken( $body-bg, 5% );
// reveal modal
$reveal-modal-bg: $panel-bg;
$reveal-border-color: $form-border-color;
$reveal-close-color: $link-color;

// sub-nav
$sub-nav-font-color: $inactive-color;
Expand Down
1 change: 0 additions & 1 deletion htdocs/scss/skins/gradation/_gradation-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ $panel-bg: lighten( $background-color, 20% );
// reveal modal
$reveal-modal-bg: $panel-bg;
$reveal-border-color: $form-border-color;
$reveal-close-color: $link-color;

// tables
$table-bg: $form-bg-color;
Expand Down
5 changes: 2 additions & 3 deletions views/components/icon-browser.tt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the same terms as Perl itself. For a copy of the license, please reference
"stc/css/components/icon-browser.css"
); -%]

<div id="js-icon-browser" class="reveal-modal icon-browser" data-reveal>
[%- WRAPPER components/modal.tt id="js-icon-browser" class="icon-browser" -%]
<div class="row">
<div class="columns medium-2 large-1">
<label class='inline' for='js-icon-browser-search'>Search:</label>
Expand Down Expand Up @@ -54,6 +54,5 @@ the same terms as Perl itself. For a copy of the license, please reference
<ul></ul>
</div>
</div></div>
<a href="#0" class="close-reveal-modal" title="Close">&#215;</a>
</div>
[%- END -%]
[%- END -%]
16 changes: 16 additions & 0 deletions views/components/modal.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[%# components/modal.tt

Wrapper block for modals

Authors:
Afuna <coder.dw@afunamatata.com>

This program is free software; you may redistribute it and/or modify it under
the same terms as Perl itself. For a copy of the license, please reference
'perldoc perlartistic' or 'perldoc perlgpl'.
%]

<div id="[%- id -%]" class="reveal-modal [%- class.join(" ") -%]" data-reveal>
[%- content -%]
<a href="#0" class="close-reveal-modal" title="Close">&#215;</a>
</div>
6 changes: 2 additions & 4 deletions views/entry/module-access.tt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ the same terms as Perl itself. For a copy of the license, please reference
<fieldset>
<div class="inner">
[% IF customgroups.size > 0 %]
<div id="js-custom-groups" class="reveal-modal custom-groups" data-reveal>

[%- WRAPPER components/modal.tt id="js-custom-groups" class="custom-groups" -%]
<fieldset class="row"><div class="columns">
<legend>[% ".header.custom" | ml %]</legend>
<ul class="no-bullet">
Expand All @@ -36,9 +36,7 @@ the same terms as Perl itself. For a copy of the license, please reference
<ul class="no-bullet" id="js-custom-group-members">
</ul>
</div></fieldset>

<a href="#0" class="close-reveal-modal" title="Close">x</a>
</div>
[% END %]

[% END %]

Expand Down

0 comments on commit 892c1bd

Please sign in to comment.