Browse Source

reset reply context state when URL is removed

pull/64/head
Aaron Parecki 5 years ago
parent
commit
40bc510cb7
No known key found for this signature in database GPG Key ID: 276C2817346D6056
2 changed files with 12 additions and 0 deletions
  1. +4
    -0
      controllers/controllers.php
  2. +8
    -0
      views/new-post.php

+ 4
- 0
controllers/controllers.php View File

@ -397,6 +397,10 @@ $app->get('/reply/preview', function() use($app) {
if($user=require_login($app)) {
$params = $app->request()->params();
if(!isset($params['url']) || !$params['url']) {
return '';
}
$reply_url = trim($params['url']);
if(preg_match('/twtr\.io\/([0-9a-z]+)/i', $reply_url, $match)) {

+ 8
- 0
views/new-post.php View File

@ -310,6 +310,14 @@ $(function(){
$("#note_in_reply_to").on('change', function(){
var reply_to = $("#note_in_reply_to").val();
if(reply_to == "") {
$(".reply-section").addClass("hidden");
$(".reply-context").addClass("hidden");
$("#expand-reply").removeClass("hidden");
return;
}
$(".reply-section .loading").removeClass("hidden");
$.get("/reply/preview", {url:reply_to}, function(data){

Loading…
Cancel
Save