Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

[SOLVED] Override Onsen UI v1 pushPage function

  • Hello,

    I would like to backport this bugfix to my v1 onsen ui apps :

    I don’t want to change the existing files, so I hoped I could somewhat redefine/override/overload the NavigatorView.pushPage function, but I can’t figure out how to do that… Any ideas ?

  • I solved my problem this way:

    // Onsen UI v1 dit not get this bugfix to prevent loading the page twice if user taps twice
    // so we backport it from
    angular.module('onsen').run(['NavigatorView', function(NavigatorView) {
        NavigatorView.prototype.pushPage = function(page, options) {
            if (this._profiling) {
            options = options || {};
            if (options.cancelIfRunning && this._isPushing) {
            if (options && typeof options != 'object') {
              throw new Error('options must be an object. You supplied ' + options);
            if (this._emitPrePushEvent()) {
            // the backport is just this line...
            this._isPushing = true;
            this._doorLock.waitUnlock(function() {
              this._pushPage(page, options);