Skip to content

Conversation

dmglab
Copy link

@dmglab dmglab commented Sep 1, 2014

This adds support to prevent hiding the offcanvas with close-on-click="false"

zurb's jquery offcanvas has a familiar behavior.

@mikeatlas
Copy link

+1 please!

@mikeatlas
Copy link

For some reason, Chrome on Android would trigger the offCanvasWrap version of the hide method when focusing in on my sidebar, whereas on a desktop, the focused element click event would fire on the offCanvasList. So, anyways, I had to also change:

.directive('offCanvasWrap', ['$window', function ($window) {
        return {
            scope: { closeOnClick: "=" },
            restrict: 'C',
            link: function ($scope, element, attrs) {
                var win = angular.element($window);
                var sidebar = $scope.sidebar = element;

                $scope.hide = function () {
                    if ($scope.closeOnClick !== false) {
                      sidebar.removeClass('move-left');
                      sidebar.removeClass('move-right');
                    }
                };

                win.bind("resize.body", $scope.hide);

                $scope.$on('$destroy', function() {
                    win.unbind("resize.body", $scope.hide);
                });

            },
   // ...

@eyafaer
Copy link

eyafaer commented Aug 12, 2015

Updates?

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

Successfully merging this pull request may close these issues.

3 participants