Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Bottomsheet should support selector to determine parent #640

Closed
ThomasBurleson opened this issue Nov 13, 2014 · 4 comments
Closed

Bottomsheet should support selector to determine parent #640

ThomasBurleson opened this issue Nov 13, 2014 · 4 comments
Milestone

Comments

@ThomasBurleson
Copy link
Contributor

If a bottomSheet parent DOM element is not provided, the InterimService will use the $rootElement body or the $rootElement as the parent container for the mask and bottomsheet.

The following enchancement is needed:

$$interimElement({
    parent: "#myBSContainer",
    onShow: onShow,
    onRemove: onRemove,
  });
@ThomasBurleson ThomasBurleson added this to the 0.8.0-rc1 milestone Nov 13, 2014
@epool
Copy link

epool commented Nov 13, 2014

I think it would be good for $mdToast.show() too.

@marcysutton
Copy link
Contributor

@joaogarin
Copy link

While using this and going through the framework for first time on the documentation it looks like you need to provide the actual element. But reading the code on the feature from @ajoslin I can see you actually need to provide the selector. Its not completely clear at least in my opinion on the documentation. Maybe I missed somewhere what the "Element" refers to in the scope of the documentation (perhaps its used in other services as well).

Anyway nice that it is there ;)

@ThomasBurleson
Copy link
Contributor Author

The parent option can be:

  • function
  • a selector string
  • a object reference
  • null/undefined (in which case the $rootElement.body || $rootElement is used).

Check out the Material-Start use of bottom sheet:

$mdBottomSheet.show({
          parent: angular.element(document.getElementById('content')),
          templateUrl: '/src/users/view/contactSheet.html',
          controller: [ '$mdBottomSheet', UserSheetController],
          controllerAs: "vm",
          bindToController : true,
          targetEvent: $event
        }).then(function(clickedItem) {
          clickedItem && $log.debug( clickedItem.name + ' clicked!');
        });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants