mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(sideMenuContent): watch drag-content attribute
This commit is contained in:
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user