Disable Post Button when Url Open Graph Preview is loading for 1.10.x

1.10.x
José Loguercio 9 years ago
parent c6121186a5
commit cf7bbfcf83
  1. 2
      main/inc/lib/social.lib.php
  2. 2
      main/social/profile.php

@ -1840,7 +1840,7 @@ class SocialManager extends UserManager
]
);
$form->addHidden('url_content', '');
$form->addButtonSend(get_lang('Post'), null, false, ['cols-size' => [1, 10, 1]]);
$form->addButtonSend(get_lang('Post'), 'wall_post_button', false, ['cols-size' => [1, 10, 1]]);
$html = Display::panel($form->returnForm(), get_lang('SocialWall'));
return $html;

@ -299,6 +299,7 @@ $(document).ready(function() {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function() {
$("[name=\'wall_post_button\']").prop( "disabled", true );
$(".panel-preview").hide();
$(".spinner").html("'.
'<div class=\'text-center\'>'.
@ -311,6 +312,7 @@ $(document).ready(function() {
url: "'. api_get_path(WEB_AJAX_PATH) .'social.ajax.php?a=readUrlWithOpenGraph",
data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"),
success: function(response) {
$("[name=\'wall_post_button\']").prop( "disabled", false );
if (!response == false) {
$(".spinner").html("");
$(".panel-preview").show();

Loading…
Cancel
Save