rugk 6 лет назад
Родитель
Сommit
d3ba7eeb13
1 измененных файлов с 27 добавлено и 8 удалено
  1. 27 8
      js/privatebin.js

+ 27 - 8
js/privatebin.js

@@ -3601,6 +3601,20 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             }
         }
 
+
+        /**
+         * Clear the attachment input in the top navigation.
+         *
+         * @name   TopNav.clearAttachmentInput
+         * @function
+         */
+        function clearAttachmentInput()
+        {
+            // hide UI for selected files
+            // our up-to-date jQuery can handle it :)
+            $fileWrap.find('input').val('');
+        }
+
         /**
          * return raw text
          *
@@ -3695,7 +3709,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             // in any case, remove saved attachment data
             AttachmentViewer.removeAttachmentData();
 
-            me.clearAttachmentInput();
+            clearAttachmentInput();
             AttachmentViewer.clearDragAndDrop();
 
             // pevent '#' from appearing in the URL
@@ -4111,16 +4125,21 @@ jQuery.PrivateBin = (function($, RawDeflate) {
         };
 
         /**
-         * Clear the attachment input in the top navigation.
+         * Reset the top navigation back to it's default values.
          *
-         * @name   TopNav.clearAttachmentInput
+         * @name   TopNav.resetInput
          * @function
          */
-        me.clearAttachmentInput = function()
+        me.resetInput = function()
         {
-            // hide UI for selected files
-            // our up-to-date jQuery can handle it :)
-            $fileWrap.find('input').val('');
+            clearAttachmentInput();
+
+            $openDiscussion.prop('checked', false);
+            $burnAfterReading.prop('checked', false);
+            $openDiscussionOption.removeClass('buttondisabled');
+            $burnAfterReadingOption.removeClass('buttondisabled');
+
+            // TODO: reset expiration time
         };
 
         /**
@@ -5144,7 +5163,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             Editor.show();
             Editor.focusInput();
             AttachmentViewer.removeAttachment();
-            TopNav.clearAttachmentInput();
+            TopNav.resetInput();
 
             TopNav.showCreateButtons();