Mattflaschen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/181227
Change subject: Replace .live function calls with .on
......................................................................
Replace .live function calls with .on
.live is not support by jQuery 1.11
Fixes T84996
Bug: T84996
Change-Id: I2a0601b2422bcae1a3c3b2ca66964372509d4acb
(cherry picked from commit debd31b9709d13ce5648e3440aec8f9e612fc354)
---
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
2 files changed, 14 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage
refs/changes/27/181227/1
diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
index 123bf65..2d320d0 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
@@ -167,6 +167,12 @@
maxLength = 250, modules = mw.config.get(
'wgPageTriageCurationModules' ),
showNoteSection = true, noteTarget = '',
noteTitle;
+ function handleFocus() {
+ $( this ).val( '' );
+ $( this ).css( 'color', 'black' );
+ $( this ).off( 'focus', handleFocus );
+ }
+
if ( status === 'unreviewed' ) {
noteTitle = 'pagetriage-add-a-note-reviewer';
// there is no reviewer recorded or the
reviewer is reverting their previous reviewed status
@@ -214,11 +220,7 @@
} else {
$( '#' + buttonId ).button(
'enable' );
}
- } ).live( 'focus', function(e) {
- $( this ).val( '' );
- $( this ).css( 'color', 'black' );
- $( this ).unbind( e );
- } ).change( function() {
+ } ).on( 'focus', handleFocus ).change(
function() {
_this.noteChanged = true;
} );
}
diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
index 3028ac0..7152c03 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
@@ -74,6 +74,12 @@
* Display the tag flyout, everything should be reset
*/
render: function() {
+ function handleFocus() {
+ $( this ).val( '' );
+ $( this ).css( 'color', 'black' );
+ $( this ).off( 'focus', handleFocus );
+ }
+
var _this = this;
this.reset();
this.$tel.html( this.template( { 'tags':
this.tagsOptions, 'warningNotice': this.model.tagWarningNotice(), 'title':
this.title, 'maxLength': this.noteMaxLength, 'creator': this.model.get(
'user_name' ) } ) );
@@ -91,11 +97,7 @@
} else {
$( '#mwe-pt-tag-submit-button'
).button( 'disable' );
}
- } ).live( 'focus', function(e) {
- $( this ).val( '' );
- $( this ).css( 'color', 'black' );
- $( this ).unbind( e );
- } ).change( function() {
+ } ).on( 'focus', handleFocus ).change( function() {
_this.noteChanged = true;
} );
--
To view, visit https://gerrit.wikimedia.org/r/181227
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a0601b2422bcae1a3c3b2ca66964372509d4acb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: wmf/1.25wmf13
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits