Merge "jquery.ui: Collapse border in ui-helper-clearfix"
[lhc/web/wiklou.git] / resources / src / mediawiki.action / mediawiki.action.edit.js
1 /*!
2 * Scripts for action=edit
3 */
4 ( function ( mw, $ ) {
5
6 $( function () {
7 var editBox, scrollTop, $editForm;
8
9 // Make sure edit summary does not exceed byte limit
10 $( '#wpSummary' ).byteLimit( 255 );
11
12 // Restore the edit box scroll state following a preview operation,
13 // and set up a form submission handler to remember this state.
14 editBox = document.getElementById( 'wpTextbox1' );
15 scrollTop = document.getElementById( 'wpScrolltop' );
16 $editForm = $( '#editform' );
17 if ( $editForm.length && editBox && scrollTop ) {
18 if ( scrollTop.value ) {
19 editBox.scrollTop = scrollTop.value;
20 }
21 $editForm.submit( function () {
22 scrollTop.value = editBox.scrollTop;
23 } );
24 }
25 } );
26
27 }( mediaWiki, jQuery ) );