Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90899
Change subject: Stash: Open the first *untranslated* message by default
......................................................................
Stash: Open the first *untranslated* message by default
Change-Id: I631537ddb8f2927a318a767aa70d3a89a34b8fb5
---
M resources/js/ext.translate.special.translationstash.js
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/99/90899/1
diff --git a/resources/js/ext.translate.special.translationstash.js
b/resources/js/ext.translate.special.translationstash.js
index 666cac1..a0a94d2 100644
--- a/resources/js/ext.translate.special.translationstash.js
+++ b/resources/js/ext.translate.special.translationstash.js
@@ -143,7 +143,7 @@
getMessages( messagegroup, $messageTable.data( 'targetlangcode'
), 0, 20 )
.done( function ( result ) {
- var messages = result.query.messagecollection;
+ var untranslated, messages =
result.query.messagecollection;
$.each( messages, function ( index, message ) {
message.properties = {};
message.properties.status =
'untranslated';
@@ -155,12 +155,16 @@
}
addMessage( message );
- if ( index === 0 ) {
- // Show the editor for the
first message.
- $( '.tux-message:first' ).data(
'translateeditor' ).show();
- }
} );
+ // Show the editor for the first untranslated
message.
+ var untranslated = $( '.tux-message' )
+ .has( '.tux-message-item.untranslated' )
+ .first();
+ if ( untranslated.length ) {
+ untranslated.data( 'translateeditor'
).show();
+ }
+
updateStats();
} ).fail( function ( errorCode, response ) {
$messageTable.empty().addClass( 'error' )
--
To view, visit https://gerrit.wikimedia.org/r/90899
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I631537ddb8f2927a318a767aa70d3a89a34b8fb5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits