Merge pull request #676 from cmho/274-add-comment-button

[274] Add comment button to comment form where browser has 'Touch' event enabled
pull/698/head
daniel 6 years ago committed by GitHub
commit cacaa6b721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,13 @@ pixelfed.readmore = () => {
}); });
}; };
try {
document.createEvent("TouchEvent");
$('body').addClass('touch');
} catch (e) {
return false;
}
window.InfiniteScroll = require('infinite-scroll'); window.InfiniteScroll = require('infinite-scroll');
window.filesize = require('filesize'); window.filesize = require('filesize');
window.Plyr = require('plyr'); window.Plyr = require('plyr');

@ -156,6 +156,7 @@
<input type="hidden" name="_token" value=""> <input type="hidden" name="_token" value="">
<input type="hidden" name="item" :value="statusId"> <input type="hidden" name="item" :value="statusId">
<input class="form-control" name="comment" placeholder="Add a comment..." autocomplete="off"> <input class="form-control" name="comment" placeholder="Add a comment..." autocomplete="off">
<input type="submit" value="Send" class="btn btn-primary comment-submit" />
</form> </form>
</div> </div>
</div> </div>

@ -267,6 +267,26 @@ body, button, input, textarea {
.card { .card {
box-shadow: 0 2px 6px 0 hsla(0, 0%, 0%, 0.2); box-shadow: 0 2px 6px 0 hsla(0, 0%, 0%, 0.2);
border: none; border: none;
.comment-submit {
display: none;
position: absolute;
bottom: 12px;
right: 20px;
width: 60px;
text-align: center;
border-radius: 0 3px 3px 0;
}
}
.touch .card {
input[name="comment"] {
padding-right: 70px;
}
.comment-submit {
display: block;
}
} }
.box-shadow { .box-shadow {

Loading…
Cancel
Save