Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/234245

Change subject: Allow partial selection in text fields
......................................................................

Allow partial selection in text fields

Really, why should this be forbidden? These onclick handlers do waaaaay
to much. They do not only block what they should block, they block way
more stuff, like resizing the textarea and interacting with it in any
way that involves the mouse. This is not the intention of this code.
I'm sorry to say that, but this code is the equivalent of "disable
right click to prevent stealing images" on 1990s web pages. Please,
please let's not do this. Let the user do what he expectes and is used
to do.

Change-Id: Ia89faea678606d5c382539f726e2edaa745c904e
---
M resources/mmv/ui/mmv.ui.download.pane.js
M resources/mmv/ui/mmv.ui.js
M resources/mmv/ui/mmv.ui.reuse.embed.js
M resources/mmv/ui/mmv.ui.reuse.share.js
4 files changed, 1 insertion(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/45/234245/1

diff --git a/resources/mmv/ui/mmv.ui.download.pane.js 
b/resources/mmv/ui/mmv.ui.download.pane.js
index 288b7f3..3f0eaf2 100644
--- a/resources/mmv/ui/mmv.ui.download.pane.js
+++ b/resources/mmv/ui/mmv.ui.download.pane.js
@@ -240,8 +240,7 @@
                } );
 
                this.attributionInput.$element.find( 'input' )
-                       .on( 'focus', this.selectAllOnEvent )
-                       .on( 'mousedown click', this.onlyFocus );
+                       .on( 'focus', this.selectAllOnEvent );
        };
 
        /**
diff --git a/resources/mmv/ui/mmv.ui.js b/resources/mmv/ui/mmv.ui.js
index 8543706..b38f03a 100644
--- a/resources/mmv/ui/mmv.ui.js
+++ b/resources/mmv/ui/mmv.ui.js
@@ -208,17 +208,6 @@
        };
 
        /**
-        * Reduces the action of clicks to solely focusing the input/textarea.
-        * Essentialy disables clicking inside the text to select a portion of 
it.
-        * Invoked with that input/textarea as context.
-        */
-       EP.onlyFocus = function ( e ) {
-               this.focus();
-               e.preventDefault();
-               return false;
-       };
-
-       /**
         * Flips E (east) and W (west) directions in RTL documents.
         * @param {string} keyword a keyword where the first 'e' or 'w' 
character means a direction (such as a
         *  tipsy gravity parameter)
diff --git a/resources/mmv/ui/mmv.ui.reuse.embed.js 
b/resources/mmv/ui/mmv.ui.reuse.embed.js
index ae73e00..d17aee9 100644
--- a/resources/mmv/ui/mmv.ui.reuse.embed.js
+++ b/resources/mmv/ui/mmv.ui.reuse.embed.js
@@ -232,9 +232,6 @@
                // Select all text once element gets focus
                $htmlTextarea.on( 'focus', this.selectAllOnEvent );
                $wikitextTextarea.on( 'focus', this.selectAllOnEvent );
-               // Disable partial text selection inside the textboxes
-               $htmlTextarea.on( 'mousedown click', this.onlyFocus );
-               $wikitextTextarea.on( 'mousedown click', this.onlyFocus );
 
                // Register handler for switching between wikitext/html snippets
                this.embedSwitch.on( 'select', $.proxy( embed.handleTypeSwitch, 
embed ) );
diff --git a/resources/mmv/ui/mmv.ui.reuse.share.js 
b/resources/mmv/ui/mmv.ui.reuse.share.js
index feb63da..cf51827 100644
--- a/resources/mmv/ui/mmv.ui.reuse.share.js
+++ b/resources/mmv/ui/mmv.ui.reuse.share.js
@@ -113,8 +113,6 @@
                var $input = this.pageInput.$element.find( 'input' );
 
                $input.on( 'focus', this.selectAllOnEvent );
-               // Disable partial text selection inside the textbox
-               $input.on( 'mousedown click', this.onlyFocus );
        };
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/234245
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia89faea678606d5c382539f726e2edaa745c904e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to