Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
update(demo, dialog): 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.

fixes #5924. Closes #9032.
  • Loading branch information
SpikesCafe-google authored and ThomasBurleson committed Jul 14, 2016
1 parent ff10018 commit 3d72243
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/components/dialog/demoBasicUsage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
</md-button>
</div>
<p class="footer">Note: The <b>Confirm</b> dialog does not use <code>$mdDialog.clickOutsideToClose(true)</code>.</p>
<div hide-gt-sm layout="row" layout-align="center center" flex>
<md-checkbox ng-model="customFullscreen" aria-label="Fullscreen Custom Dialog">Force Custom Dialog Fullscreen</md-checkbox>
</div>

<div ng-if="status" id="status">
<b layout="row" layout-align="center center" class="md-padding">
Expand All @@ -38,6 +35,8 @@
<div class="dialog-demo-prerendered">
<md-checkbox ng-model="listPrerenderedButton">Show Pre-Rendered Dialog</md-checkbox>
<p class="md-caption">Sometimes you may not want to compile the dialogs template on each opening.</p>
<md-checkbox ng-model="customFullscreen" aria-label="Fullscreen custom dialog">Use full screen mode for custom dialog</md-checkbox>
<p class="md-caption">Allows the dialog to consume all available space on small devices</p>
</div>


Expand Down
17 changes: 3 additions & 14 deletions src/components/dialog/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
angular.module('dialogDemo1', ['ngMaterial'])

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

$scope.showAlert = function(ev) {
// Appending dialog to document.body to cover sidenav in docs app
Expand Down Expand Up @@ -57,30 +57,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
fullscreen: $scope.customFullscreen // Only for -xs, -sm breakpoints.
})
.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 3d72243

Please sign in to comment.