Skip to content

notify: support sub views #1892

Closed
Closed
@oliverfoster

Description

  • 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

Activity

self-assigned this
on Dec 7, 2017
added a commit that references this issue on Dec 7, 2017
oliverfoster

oliverfoster commented on Dec 7, 2017

@oliverfoster
MemberAuthor

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

oliverfoster commented on Dec 7, 2017

@oliverfoster
MemberAuthor

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

oliverfoster

oliverfoster commented on Dec 13, 2017

@oliverfoster
MemberAuthor

also solves #1759

added a commit that references this issue on Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    notify: support sub views · Issue #1892 · adaptlearning/adapt_framework