Skip to content

Commit

Permalink
add overlay option
Browse files Browse the repository at this point in the history
  • Loading branch information
voronianski committed Nov 5, 2014
1 parent 5702542 commit 7856643
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 0.3.3

# 0.3.0

# 0.2.0

# 0.1.0
11 changes: 10 additions & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
ng-dialog-show-close="false">Open via directive with pre-close callback</button>
<a href="" ng-click="openConfirmWithPreCloseCallbackOnScope()">Open confirm modal with pre-close callback on scope</a>
<a href="" ng-click="openConfirmWithPreCloseCallbackInlinedWithNestedConfirm()">Open confirm modal with pre-close inlined with nested confirm.</a>
<a href="" ng-click="openWithoutOverlay()">Open without overlay</a>

<!-- Templates -->

Expand Down Expand Up @@ -229,7 +230,6 @@ <h3>ngDialog modal example</h3>
});
};


$scope.openPlain = function () {
$rootScope.theme = 'ngdialog-theme-plain';

Expand Down Expand Up @@ -307,6 +307,15 @@ <h3>ngDialog modal example</h3>
});
};

$scope.openWithoutOverlay = function () {
ngDialog.open({
template: '<h2>Notice that there is no overlay!</h2>',
className: 'ngdialog-theme-default',
plain: true,
overlay: false
});
};

$rootScope.$on('ngDialog.opened', function (e, $dialog) {
console.log('ngDialog opened: ' + $dialog.attr('id'));
});
Expand Down
5 changes: 4 additions & 1 deletion js/ngDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
closeByNavigation: false,
appendTo: false,
preCloseCallback: false,
overlay: true,
cache: true
};

Expand Down Expand Up @@ -192,7 +193,9 @@
}

self.$result = $dialog = $el('<div id="ngdialog' + globalID + '" class="ngdialog"></div>');
$dialog.html('<div class="ngdialog-overlay"></div><div class="ngdialog-content">' + template + '</div>');
$dialog.html((options.overlay ?
'<div class="ngdialog-overlay"></div><div class="ngdialog-content">' + template + '</div>' :
'<div class="ngdialog-content">' + template + '</div>'));

if (options.data && angular.isString(options.data)) {
var firstLetter = options.data.replace(/^\s*/, '')[0];
Expand Down

0 comments on commit 7856643

Please sign in to comment.