]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't put reply in a popup, it was undesired for users
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 7 Mar 2015 22:35:41 +0000 (23:35 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 7 Mar 2015 22:36:27 +0000 (23:36 +0100)
Maybe could make that optional or something in the DefaultLayout plugin...

js/util.js
lib/noticelistitem.php

index 84a542bbda3d3f0a728760b27ad304b851842aa4..f41cd07699d5938565a6edf5af3bfc634f0f47b2 100644 (file)
@@ -579,7 +579,7 @@ var SN = { // StatusNet
          * Setup function -- DOES NOT trigger actions immediately.
          *
          * Sets up event handlers on all visible notice's option <a> elements
-         * so they are called with AJAX enabled.
+         * with the "popup" class so they behave as expected with AJAX.
          *
          * (without javascript the link goes to a page that expects you to verify
          * the action through a form)
@@ -587,17 +587,17 @@ var SN = { // StatusNet
          * @access private
          */
         NoticeOptionsAjax: function () {
-            $(document).on('click', '.notice-options > a', function (e) {
+            $(document).on('click', '.notice-options > a.popup', function (e) {
                 e.preventDefault();
                 var noticeEl = $(this).closest('.notice');
                 $.get($(this).attr('href'), {ajax: 1}, function (data, textStatus, xhr) {
-                    SN.U.NoticeOptionPopup(data);
+                    SN.U.NoticeOptionPopup(data, noticeEl);
                 });
                 return false;
             });
         },
 
-        NoticeOptionPopup: function (data) {
+        NoticeOptionPopup: function (data, noticeEl) {
             title = $('head > title', data).text();
             body = $('body', data).html();
             dialog = $(body).dialog({
@@ -651,20 +651,10 @@ var SN = { // StatusNet
             var parentNotice = notice;
             var stripForm = true; // strip a couple things out of reply forms that are inline
 
-            var list = notice.closest('.notices');
-            if (list.hasClass('threaded-replies')) {
-                // We're replying to a reply; use reply form on the end of this list.
-            } else {
-                // We're replying to a parent notice; pull its threaded list
-                // and we'll add on the end of it. Will add the threaded list if needed.
-                var list = $('ul.threaded-replies', notice);
-                if (list.length == 0) {
-                    list = $('<ul class="notices threaded-replies xoxo"></ul>');
-                    notice.append(list);
-                    list = notice.find('ul.threaded-replies');
-                }
+            var list = notice.find('.threaded-replies');
+            if (list.length == 0) {
+                list = notice.closest('.threaded-replies');
             }
-
             var nextStep = function () {
                 // Override...?
                 replyForm.find('input[name=inreplyto]').val(id);
@@ -675,6 +665,7 @@ var SN = { // StatusNet
                     replyForm.find('label[for=notice_to]').hide();
                     replyForm.find('label[for=notice_private]').hide();
                 }
+                replyItem.show();
 
                 // Set focus...
                 var text = replyForm.find('textarea');
@@ -694,7 +685,7 @@ var SN = { // StatusNet
                 }
             };
 
-            // Create the reply form entry at the end
+            // Create the reply form entry
             var replyItem = $('li.notice-reply', list);
             if (replyItem.length == 0) {
                 replyItem = $('<li class="notice-reply"></li>');
@@ -712,11 +703,7 @@ var SN = { // StatusNet
                 });
             } else {
                 replyForm = replyItem.children('form');
-                if (SN.Init.NoticeFormSetup(replyForm)) {
-                    nextStep();
-                }
-                replyItem.show();
-                replyItem.find('textarea').focus();
+                nextStep();
             }
         },
 
index eb0d7216f0d53c4c0431dccc4940403a2b8f192e..282ace3724afdd3985b4bdce030a6eca5df35236 100644 (file)
@@ -596,7 +596,7 @@ class NoticeListItem extends Widget
             $deleteurl = common_local_url('deletenotice',
                                           array('notice' => $todel->id));
             $this->out->element('a', array('href' => $deleteurl,
-                                           'class' => 'notice_delete',
+                                           'class' => 'notice_delete popup',
                                            // TRANS: Link title in notice list item to delete a notice.
                                            'title' => _('Delete this notice from the timeline.')),
                                            // TRANS: Link text in notice list item to delete a notice.