Merge "mediawiki.Upload: Add #getApi method, use it instead of undocumented properties"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.Upload.BookletLayout.js
index 26eabc7..1cd9101 100644 (file)
         */
        mw.Upload.BookletLayout.prototype.initialize = function () {
                var
-                       apiPromise,
                        booklet = this,
                        deferred = $.Deferred();
 
                this.upload = this.createUpload();
                this.setPage( 'upload' );
 
-               apiPromise = this.upload.apiPromise || $.Deferred().resolve( this.upload.api );
-               apiPromise.done( function ( api ) {
+               this.upload.getApi().done( function ( api ) {
                        // If the user can't upload anything, don't give them the option to.
                        api.getUserInfo().done( function ( userInfo ) {
                                if ( userInfo.rights.indexOf( 'upload' ) === -1 ) {