Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/178219
Change subject: Fix overzealous textarea click handler
......................................................................
Fix overzealous textarea click handler
Do not select the text when the user clicks on an already focused
textbox. This makes it possible to select parts of the text and
scroll it (by dragging the selection).
Change-Id: Id2206a9b2c03a76514ac09d3248c158f62f0f128
---
M resources/mmv/ui/mmv.ui.js
1 file changed, 9 insertions(+), 5 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer
refs/changes/19/178219/1
diff --git a/resources/mmv/ui/mmv.ui.js b/resources/mmv/ui/mmv.ui.js
index 60a424f..c46ad49 100644
--- a/resources/mmv/ui/mmv.ui.js
+++ b/resources/mmv/ui/mmv.ui.js
@@ -223,10 +223,14 @@
* Makes the entire input/textarea selected when focused.
* Invoked with that input/textarea as context.
*/
- EP.selectAllOnEvent = function () {
+ EP.selectAllOnEvent = function ( e ) {
+ if ( $( e.target ).is( ':focus' ) ) {
+ // clicking into a focused element should clear focus
and allow selecting part of the text
+ return;
+ }
try {
this.select();
- } catch ( e ) {
+ } catch ( err ) {
// IE doesn't like when select() is called during the
onfocus handler
}
};
@@ -237,9 +241,9 @@
* Invoked with that input/textarea as context.
*/
EP.onlyFocus = function ( e ) {
- this.focus();
- e.preventDefault();
- return false;
+// this.focus();
+// e.preventDefault();
+// return false;
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/178219
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2206a9b2c03a76514ac09d3248c158f62f0f128
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits