Skip to content

Commit

Permalink
feat(sideMenuContent): watch drag-content attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Feb 7, 2014
1 parent b11e0f5 commit 7f9bfb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions js/ext/angular/src/directive/ionicSideMenu.js
Expand Up @@ -7,7 +7,7 @@
* left and/or right menu, which a center content area.
*/

angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.view'])
angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.view'])

/**
* The internal controller for the side menu controller. This
Expand Down Expand Up @@ -60,7 +60,9 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie

$element.addClass('menu-content');

$scope.dragContent = $scope.$eval($attr.dragContent) === false ? false : true;
$scope.$watch(attr.dragContent, function(value) {
$scope.dragContent = value;
});

var defaultPrevented = false;
var isDragging = false;
Expand Down
3 changes: 2 additions & 1 deletion js/ext/angular/test/sideMenu.html
Expand Up @@ -17,12 +17,13 @@

<div ng-controller="MenuCtrl">
<side-menus>
<pane side-menu-content>
<pane side-menu-content drag-content="$root.$draggy">
<header class="bar bar-header bar-assertive">
<button class="button button-icon" ng-click="openLeft()"><i class="icon ion-navicon"></i></button>
<h1 class="title">Slide me</h1>
</header>
<content has-header="true">
<toggle ng-model="$root.$draggy">Hello</toggle>
<h1>Content</h1>
</content>
</pane>
Expand Down

0 comments on commit 7f9bfb5

Please sign in to comment.