Example #1
0
    open: function(view){
        this.$el.empty().append(view.el);

        // ensure the relationship is maintained
        // any key presses should be handled first
        // by the this.view. If it chooses not to handle
        // then, then we get our chance to handle them here.
        keys.registerInResponderChain(this);
        keys.registerInResponderChain(view);

        // if we click anywhere outside of this
        // pop view, we want this view to destroy.
        this._clicks = new ClickTestResponder({
            el: view.$el,
            clickOutside: _.bind(this.wantsDismissFromClick, this)
        });

        view.once('complete', _.bind(this.destroy, this));
    },
Example #2
0
        BUILT: function() {

            // Key Management
            // If you are not using the modal system,
            // but are using the key system, you can omit
            // the dictionary passed here.
            keys.initialize();

            // The responder chain is a stack of views/controllers.
            // When a key event is detected, the stack is searched
            // from the bottom up. AKA Last in First Out (LIFO).
            // Views that participate in the chain can choose to implement
            // keyDown(e) or performKeyEquivalent(e).
            //
            // performKeyEquivalent is checked first then keyDown is checked.
            // If either of those returns 'true' the chain is no longer traversed.
            //
            // Note that we automatically add the ApplicationDelegate.
            // This ensures it will be the last one checked for key events.
            // Then we implement keyDown above to handle looking for
            // our desired key press.
            //
            // Any additional view or controller that would like
            // to participate in this chain is required to register
            // itself into the chain like we do here.
            keys.registerInResponderChain(this);

            // Modal Management
            // These handlers are present so you can define how the modal is
            // shown. AKA via animation, or some other means.
            //
            // You should NEVER call these directly.
            this.listenTo(vent, modals.events.PRESENT, this._presentModal);
            this.listenTo(vent, modals.events.DISMISS, this._dismissModal);

            // Activity Management
            // Like modal managerment, these handlers are present so you can define
            // how the network activity indicator is presented. AKA via animation
            // or some other means.
            //
            // You should NEVER call these directly.
            this.listenTo(vent, activity.events.PRESENT, this._presentNetworkActivityIndicator);
            this.listenTo(vent, activity.events.DISMISS, this._dismissNetworkActivityIndicator);
        },