Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify: support sub views #1892

Closed
oliverfoster opened this issue Dec 7, 2017 · 3 comments
Closed

notify: support sub views #1892

oliverfoster opened this issue Dec 7, 2017 · 3 comments
Assignees

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Dec 7, 2017

  • handle a pre-instantiated sub view
  • allow sub view to force the notify to resize
  • allow sub view to close the notify
  • allow sub view to cancel the notify (triggers notify:cancelled)
  • provide a hook to sub view to run when popup is opened
  • provide hook to to sub view to run when popup is closed
  • provide mechanism to stop notify being cancellable
@oliverfoster
Copy link
Member Author

oliverfoster commented Dec 7, 2017

pr allows:

define([
    'core/js/adapt'
], function(Adapt) {

    var PopupView = Backbone.View.extend({

        initialize: function() {
              this.listenToOnce(Adapt, "notify:opened", this.onOpened);
        },

        onOpened: function(notifyView) {
              // notifyView.subView === this
        },

        remove: function() {
              // called when notify is closed
        }

    });

    return PopupView;

});

 
Adapt.trigger("notify:popup", {
    title: "Testing",
    _isCancellable: false, // hides close button and stops esc and shadow close (default true)
    _view: new PopupView({ model: new Backbone.Model({}) })
});

Adapt.trigger("notify:cancel");
Adapt.trigger("notify:close");
Adapt.trigger("notify:resize");

@oliverfoster
Copy link
Member Author

oliverfoster commented Dec 7, 2017

need to add a flag to stop the notify from being closed with a background click
_isCancellable added to notifyObject

@oliverfoster
Copy link
Member Author

also solves #1759

moloko pushed a commit that referenced this issue Feb 16, 2018
* issue/1892: added notify subview suppoprt

#1892

* issue/1892: notify subview improvements

* issue/1892: improved readability

* issue/1892: removed imageready conditional

* add extra method to itemsComponentModel

* rename method to setActiveItem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant