Skip to content

Commit

Permalink
Merge pull request #1492 from /issues/1475
Browse files Browse the repository at this point in the history
Fixes #1475 - removed side effect when button is active
  • Loading branch information
Mike Taylor authored Apr 10, 2017
2 parents e8a2adc + 4275b35 commit 3a8a188
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
1 change: 1 addition & 0 deletions webcompat/static/css/development/components/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
position: absolute;
opacity: 0;
z-index: 1;
width: 100%;
top:0;
right: 0;
bottom: 0;
Expand Down
5 changes: 5 additions & 0 deletions webcompat/static/css/development/components/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
/* group item */
.wc-Form-group {
position: relative;
margin: 0 0 1em 0;
}

.wc-Form-group--biggerOffset {
margin: 0 0 2em 0;
}

/* information: wrap label and helpMessage */
.wc-Form-information {
display: flex;
Expand Down
13 changes: 0 additions & 13 deletions webcompat/static/css/development/components/report-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@
margin-top: 1em;
}

.wc-ReportForm .wc-UploadForm {
border: dashed 1px rgb(204, 204, 204);
border-radius: 20px;
}

.wc-ReportForm .r-Grid-cell {
margin-bottom: 1em;
}
.wc-ReportForm div.r-minM--1of2:nth-child(2) .wc-Form-group {
margin-bottom: 2em;
}

@media all and (min-width: 30.75em) {

/* space between button */
.wc-ReportForm-actions-button + .wc-ReportForm-actions-button {
margin-left: .6em;
Expand Down
13 changes: 10 additions & 3 deletions webcompat/static/css/development/components/upload-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
overflow: hidden;
}

/* modifier homepage uploadform */

.wc-UploadForm--homePage {
border: dashed 1px rgb(204, 204, 204);
border-radius: 20px;
}

/* modifier new comment of existing bug */
.wc-UploadForm--new {
display:flex;
display: flex;
background-color: #404040;
min-height: 35px;
}
Expand Down Expand Up @@ -47,7 +54,7 @@
position: relative;
display: inline-block;
margin-bottom: 5px;
color: #CCCCCC;
color: #ccc;
font-weight: 700;
cursor: pointer;
text-decoration: underline;
Expand All @@ -62,7 +69,7 @@

/* link */
.wc-UploadForm-label--link {
color: #FFC900;
color: #ffc900;
font-weight: 600;
text-decoration: underline;
}
Expand Down
2 changes: 2 additions & 0 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ function BugForm() {
$(".wc-UploadForm-label").show();

removeBanner.removeClass("is-hidden");
removeBanner.attr("tabIndex", "0");
uploadWrapper.addClass("is-hidden");
removeBanner.on(
"click",
Expand All @@ -427,6 +428,7 @@ function BugForm() {
// remove the preview and hide the banner
label.css("background", "none");
removeBanner.addClass("is-hidden");
removeBanner.attr("tabIndex", "-1");
uploadWrapper.removeClass("is-hidden");
removeBanner.off("click");

Expand Down
29 changes: 20 additions & 9 deletions webcompat/templates/home-page/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3 class="wc-Title--s">Report Site Issue</h3>
</div>
</div>
<div class="r-Grid-cell r-minM--1of2">
<div class="wc-Form-group js-Form-group {% if form.url.errors %}is-error{% endif %}">
<div class="wc-Form-group wc-Form-group--biggerOffset js-Form-group {% if form.url.errors %}is-error{% endif %}">
<div class="wc-Form-information">
{{ form.url.label(class_='wc-Form-label') }}
{% if form.url.errors %}
Expand All @@ -46,13 +46,13 @@ <h3 class="wc-Title--s">Report Site Issue</h3>
required=True, type='url', pattern='') }}
</span>
</div>
<div class="wc-Form-group js-Form-group">
<div class="wc-Form-group wc-Form-group--biggerOffset js-Form-group">
{{ form.browser.label(class_='wc-Form-label') }}
<span class="wc-Form-validation">
{{ form.browser(class_='wc-Form-item') }}
</span>
</div>
<div class="wc-Form-group js-Form-group">
<div class="wc-Form-group wc-Form-group--biggerOffset js-Form-group">
{{ form.os.label(class_='wc-Form-label') }}
<span class="wc-Form-validation">
{{ form.os(class_='wc-Form-item') }}
Expand All @@ -68,7 +68,10 @@ <h3 class="wc-Title--s">Report Site Issue</h3>
</div>
<div class="r-Grid-cell r-Grid-cell--alignBottom r-minS--1of2">
<div class="js-image-upload wc-Form-group js-Form-group {% if form.image.errors %}is-error{% endif %}">
<label class="wc-UploadForm js-image-upload-label" for="image">
<label
class="wc-UploadForm wc-UploadForm--homePage js-image-upload-label"
for="image"
>
<div class="wc-UploadForm-wrapper">
<div class="wc-UploadForm-icon" aria-hidden="true">
<span class="wc-Icon wc-Icon--cloud-upload"></span>
Expand All @@ -81,11 +84,19 @@ <h3 class="wc-Title--s">Report Site Issue</h3>
{% endif %}
{{ form.image(class_='wc-ButtonUpload', accept='.jpe,.jpg,.jpeg,.gif,.png,.bmp') }}
</div>
<button class="wc-UploadForm-button is-hidden r-ResetButton"
role="button"
type="button">
<img class="wc-Upload-Loader js-Upload-Loader" src="/img/upload-loader.svg" alt="Uploading image">
Remove image upload</button>
<button
class="wc-UploadForm-button is-hidden r-ResetButton"
role="button"
type="button"
tabindex="-1"
>
<img
class="wc-Upload-Loader js-Upload-Loader"
src="/img/upload-loader.svg"
alt="Uploading image"
>
Remove image upload
</button>
</label>
</div>
</div>
Expand Down

0 comments on commit 3a8a188

Please sign in to comment.