Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P7756
(An Untitled Masterwork)
Active
Public
Actions
Authored by
matmarex
on Nov 2 2018, 11:10 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F27018774:
Nov 2 2018, 11:10 AM
2018-11-02 11:10:32 (UTC+0)
Subscribers
None
// Jeśli gadżet jest włączony, poczekaj, aż się załaduje
mw.loader.using( 'user.options' )
.then( function () {
if ( mw.user.options.get( 'gadget-foo' ) ) {
return mw.loader.using( 'ext.gadget.foo' );
} else {
return $.Deferred().resolve();
}
} )
.then( function () {
// Reszta kodu gadżetu...
...
} );
Event Timeline
matmarex
created this paste.
Nov 2 2018, 11:10 AM
2018-11-02 11:10:32 (UTC+0)
Log In to Comment