Răsfoiți Sursa

Merge branch 'Haocen-505-patch'

El RIDO 7 ani în urmă
părinte
comite
ff68043c9f
3 a modificat fișierele cu 17 adăugiri și 17 ștergeri
  1. 15 15
      js/privatebin.js
  2. 1 1
      tpl/bootstrap.php
  3. 1 1
      tpl/page.php

+ 15 - 15
js/privatebin.js

@@ -2145,18 +2145,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             return isPreview;
         };
 
-        /**
-         * gets the visibility of the editor
-         *
-         * @name   Editor.isHidden
-         * @function
-         * @return {bool}
-         */
-        me.isHidden = function()
-        {
-            return $message.hasClass('hidden');
-        };
-
         /**
          * reset the Editor view
          *
@@ -2855,7 +2843,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
                 evt.stopPropagation();
                 evt.preventDefault();
 
-                if (Editor.isHidden()) {
+                if (TopNav.isAttachmentReadonly()) {
                     return false;
                 }
 
@@ -2873,7 +2861,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
 
             $(document).draghover().on({
                 'draghoverstart': function(e) {
-                    if (Editor.isHidden()) {
+                    if (TopNav.isAttachmentReadonly()) {
                         e.stopPropagation();
                         e.preventDefault();
                         return false;
@@ -2903,7 +2891,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
          */
         function addClipboardEventHandler() {
             $(document).on('paste', function (event) {
-                if (Editor.isHidden()) {
+                if (TopNav.isAttachmentReadonly()) {
                     event.stopPropagation();
                     event.preventDefault();
                     return false;
@@ -3845,6 +3833,18 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             $formatter.parent().find(`a[data-format="${format}"]`).click();
         }
 
+        /**
+         * returns if attachment dropdown is readonly, not editable
+         * 
+         * @name   TopNav.isAttachmentReadonly
+         * @function
+         * @return {bool}
+         */
+        me.isAttachmentReadonly = function()
+        {
+            return $attach.hasClass('hidden');
+        }
+
         /**
          * init navigation manager
          *

+ 1 - 1
tpl/bootstrap.php

@@ -71,7 +71,7 @@ if ($MARKDOWN):
 endif;
 ?>
 		<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-sbttN5BzzD/cAqT1Edc2CEcDUYezir6lumxlxa5byimoxnlHv8IK7kRnb/9EEhMyItl0DZIQhylaKCbCknUhAw==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-86VTqw2HsaCQ0DAunK2MH68P+8RLbbaK7HZP8nwDtwNoF44usxDCptmD8TC+zwQc7HM46AkrvVFb3ZkIb6VhMQ==" crossorigin="anonymous"></script>
 		<!--[if IE]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
 		<![endif]-->

+ 1 - 1
tpl/page.php

@@ -49,7 +49,7 @@ if ($MARKDOWN):
 endif;
 ?>
 		<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-sbttN5BzzD/cAqT1Edc2CEcDUYezir6lumxlxa5byimoxnlHv8IK7kRnb/9EEhMyItl0DZIQhylaKCbCknUhAw==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-86VTqw2HsaCQ0DAunK2MH68P+8RLbbaK7HZP8nwDtwNoF44usxDCptmD8TC+zwQc7HM46AkrvVFb3ZkIb6VhMQ==" crossorigin="anonymous"></script>
 		<!--[if IE]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
 		<![endif]-->