jenkins-bot has submitted this change and it was merged.
Change subject: Wrap insertables inside textarea
......................................................................
Wrap insertables inside textarea
Maybe not the best design, but easy to implement
Bug: T78538
Change-Id: I788ad95486a2b54289d1fac36801b2bf9b4dbc82
---
M resources/js/ext.translate.editor.helpers.js
M resources/js/ext.translate.editor.js
2 files changed, 17 insertions(+), 0 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/js/ext.translate.editor.helpers.js
b/resources/js/ext.translate.editor.helpers.js
index 1da5c6a..55f5672 100644
--- a/resources/js/ext.translate.editor.helpers.js
+++ b/resources/js/ext.translate.editor.helpers.js
@@ -472,6 +472,8 @@
} );
$textarea.focus().trigger( 'input' );
} );
+
+ this.resizeInsertables( $textarea );
},
/**
diff --git a/resources/js/ext.translate.editor.js
b/resources/js/ext.translate.editor.js
index d255d03..872bd46 100644
--- a/resources/js/ext.translate.editor.js
+++ b/resources/js/ext.translate.editor.js
@@ -581,6 +581,7 @@
if ( original !== '' ) {
$discardChangesButton.removeClass(
'hide' );
+ translateEditor.resizeInsertables(
$textarea );
}
/* Avoid Unsaved marking when translated
message is not changed in content.
@@ -656,6 +657,7 @@
translateEditor.makeSaveButtonContextSensitive( $saveButton );
translateEditor.markUnunsaved();
+
translateEditor.resizeInsertables( $textarea );
} );
}
@@ -1171,6 +1173,19 @@
return false;
} );
+ },
+
+ /**
+ * Makes the textare large enough for insertables and positions
the insertables.
+ */
+ resizeInsertables: function ( $textarea ) {
+ var $buttonArea, buttonAreaHeight;
+
+ $buttonArea = $( '.tux-editor-insert-buttons' );
+ buttonAreaHeight = $buttonArea.height();
+ $textarea.css( 'padding-bottom', buttonAreaHeight + 10
);
+ $buttonArea.css( 'top', -buttonAreaHeight - 5 );
+ autosize.update( $textarea );
}
};
--
To view, visit https://gerrit.wikimedia.org/r/278259
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I788ad95486a2b54289d1fac36801b2bf9b4dbc82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits