Skip to content

Commit

Permalink
Remove $mdMedia references from mdDialog example
Browse files Browse the repository at this point in the history
cleanup $mdMedia references in example. fullscreen only applies when the screen is xs and sm even when set to true.

See also angular#5924
  • Loading branch information
SpikesCafe-google authored Jul 14, 2016
1 parent d897b83 commit 8915193
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/components/dialog/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ angular.module('dialogDemo1', ['ngMaterial'])

.controller('AppCtrl', function($scope, $mdDialog, $mdMedia) {
$scope.status = ' ';
$scope.customFullscreen = $mdMedia('xs') || $mdMedia('sm');

$scope.showAlert = function(ev) {
// Appending dialog to document.body to cover sidenav in docs app
Expand Down Expand Up @@ -57,30 +56,19 @@ angular.module('dialogDemo1', ['ngMaterial'])
};

$scope.showAdvanced = function(ev) {
var useFullScreen = ($mdMedia('sm') || $mdMedia('xs')) && $scope.customFullscreen;

$mdDialog.show({
controller: DialogController,
templateUrl: 'dialog1.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: useFullScreen
clickOutsideToClose: true,
fullscreen: true // only applies for screen size xs and sm
})
.then(function(answer) {
$scope.status = 'You said the information was "' + answer + '".';
}, function() {
$scope.status = 'You cancelled the dialog.';
});



$scope.$watch(function() {
return $mdMedia('xs') || $mdMedia('sm');
}, function(wantsFullScreen) {
$scope.customFullscreen = (wantsFullScreen === true);
});

};

$scope.showTabDialog = function(ev) {
Expand Down

0 comments on commit 8915193

Please sign in to comment.