Page MenuHomeWickedGov Phorge

watchlistExpiry.js
No OneTemporary

Size
847 B
Referenced Files
None
Subscribers
None

watchlistExpiry.js

/*!
* Scripts for WatchlistExpiry on action=edit
*/
'use strict';
// Toggle the watchlist-expiry dropdown's disabled state according to the
// selected state of the watchthis checkbox.
$( () => {
// The 'wpWatchthis' and 'wpWatchlistExpiry' fields come from EditPage.php.
const watchThisNode = document.getElementById( 'wpWatchthisWidget' ),
expiryNode = document.getElementById( 'wpWatchlistExpiryWidget' );
if ( watchThisNode && expiryNode ) {
const watchThisWidget = OO.ui.infuse( watchThisNode );
const expiryWidget = OO.ui.infuse( expiryNode );
// Set initial state to match the watchthis checkbox.
expiryWidget.setDisabled( !watchThisWidget.isSelected() );
// Change state on every change of the watchthis checkbox.
watchThisWidget.on( 'change', ( enabled ) => {
expiryWidget.setDisabled( !enabled );
} );
}
} );

File Metadata

Mime Type
text/plain
Expires
Tue, Aug 18, 22:47 (9 h, 7 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0e/41/51f5e5f6721925663a1f44f78a11
Default Alt Text
watchlistExpiry.js (847 B)

Event Timeline