Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76116
Change subject: Style changes to jquery.placeholder
......................................................................
Style changes to jquery.placeholder
also add release notes for I25255b2
Change-Id: Iaab38cc041d143228332e00092f8521f6f3de596
---
M RELEASE-NOTES-1.22
M resources/jquery/jquery.placeholder.js
2 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/16/76116/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 0d4bee7..4f09c034 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -163,6 +163,7 @@
The special page form received a new checkbox matching that option.
* (bug 23580) Implement javascript callback interface "mw.hook".
* (bug 30713) New mw.hook "wikipage.content".
+* (bug 40430) jquery.placeholder takes placeholder text as parameter now.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
diff --git a/resources/jquery/jquery.placeholder.js
b/resources/jquery/jquery.placeholder.js
index 73f701b..12ce396 100644
--- a/resources/jquery/jquery.placeholder.js
+++ b/resources/jquery/jquery.placeholder.js
@@ -12,21 +12,21 @@
$.fn.placeholder = function ( text ) {
// Check whether supplied argument is a string
- var textIsValid = ( typeof text === 'string' );
+ var textIsValid = typeof text === 'string';
return this.each( function () {
var placeholder, $input;
+ if ( textIsValid ) {
+ this.setAttribute( 'placeholder', text );
+ }
// If the HTML5 placeholder attribute is supported, use
it
if ( this.placeholder && 'placeholder' in
document.createElement( this.tagName ) ) {
- if ( textIsValid ) {
- this.setAttribute( 'placeholder', text
);
- }
return;
}
- placeholder = textIsValid ? text : this.getAttribute(
'placeholder' );
+ placeholder = this.getAttribute( 'placeholder' );
$input = $(this);
// Show initially, if empty
--
To view, visit https://gerrit.wikimedia.org/r/76116
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaab38cc041d143228332e00092f8521f6f3de596
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits