Browse Source
reset reply context state when URL is removed
pull/64/head
Aaron Parecki
8 years ago
No known key found for this signature in database
GPG Key ID: 276C2817346D6056
2 changed files with
12 additions and
0 deletions
-
controllers/controllers.php
-
views/new-post.php
|
|
@ -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)) { |
|
|
|
|
|
@ -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){ |
|
|
|
|
|
|
|