Skip to content

Commit fa8982b

Browse files
committed
Release v1.0.5
* add `click` option * add `isModalOpen` service method
1 parent 133068f commit fa8982b

File tree

6 files changed

+31
-19
lines changed

6 files changed

+31
-19
lines changed

demo/build/bundle.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32965,7 +32965,7 @@ module.exports = angular;
3296532965
* @copyright Pathgather 2015
3296632966
* @license MIT
3296732967
* @link https://github.com/Pathgather/popeye
32968-
* @version 1.0.4
32968+
* @version 1.0.5
3296932969
*/
3297032970

3297132971
(function() {
@@ -32989,7 +32989,8 @@ module.exports = angular;
3298932989
resolve: null,
3299032990
scope: null,
3299132991
controller: null,
32992-
keyboard: true
32992+
keyboard: true,
32993+
click: true
3299332994
},
3299432995
$get: ["$q", "$animate", "$rootScope", "$document", "$http", "$templateCache", "$compile", "$controller", "$injector", function($q, $animate, $rootScope, $document, $http, $templateCache, $compile, $controller, $injector) {
3299532996
var PopeyeModal, currentModal, pendingPromise;
@@ -33104,11 +33105,13 @@ module.exports = angular;
3310433105
return templatePromise.then(function(tmpl) {
3310533106
var body, bodyLastChild;
3310633107
angular.element(containerElement[0].querySelector(".popeye-modal")).append(tmpl.data);
33107-
containerElement.on("click", function(evt) {
33108-
if (evt.target === evt.currentTarget) {
33109-
return _this.close();
33110-
}
33111-
});
33108+
if (_this.options.click) {
33109+
containerElement.on("click", function(evt) {
33110+
if (evt.target === evt.currentTarget) {
33111+
return _this.close();
33112+
}
33113+
});
33114+
}
3311233115
_this.container = $compile(containerElement)(_this.scope);
3311333116
_this.element = angular.element(_this.container[0].querySelector(".popeye-modal"));
3311433117
if (_this.options.modalClass) {
@@ -33188,6 +33191,9 @@ module.exports = angular;
3318833191
currentModal.close(value);
3318933192
}
3319033193
return currentModal;
33194+
},
33195+
isModalOpen: function() {
33196+
return !!currentModal;
3319133197
}
3319233198
};
3319333199
}]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-popeye",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "A simple modal library for AngularJS applications",
55
"files": [
66
"release/"

release/popeye.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @copyright Pathgather 2015
77
* @license MIT
88
* @link https://github.com/Pathgather/popeye
9-
* @version 1.0.4
9+
* @version 1.0.5
1010
*/
1111

1212
body.popeye-modal-open {

release/popeye.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @copyright Pathgather 2015
77
* @license MIT
88
* @link https://github.com/Pathgather/popeye
9-
* @version 1.0.4
9+
* @version 1.0.5
1010
*/
1111

1212
(function() {
@@ -30,7 +30,8 @@
3030
resolve: null,
3131
scope: null,
3232
controller: null,
33-
keyboard: true
33+
keyboard: true,
34+
click: true
3435
},
3536
$get: ["$q", "$animate", "$rootScope", "$document", "$http", "$templateCache", "$compile", "$controller", "$injector", function($q, $animate, $rootScope, $document, $http, $templateCache, $compile, $controller, $injector) {
3637
var PopeyeModal, currentModal, pendingPromise;
@@ -145,11 +146,13 @@
145146
return templatePromise.then(function(tmpl) {
146147
var body, bodyLastChild;
147148
angular.element(containerElement[0].querySelector(".popeye-modal")).append(tmpl.data);
148-
containerElement.on("click", function(evt) {
149-
if (evt.target === evt.currentTarget) {
150-
return _this.close();
151-
}
152-
});
149+
if (_this.options.click) {
150+
containerElement.on("click", function(evt) {
151+
if (evt.target === evt.currentTarget) {
152+
return _this.close();
153+
}
154+
});
155+
}
153156
_this.container = $compile(containerElement)(_this.scope);
154157
_this.element = angular.element(_this.container[0].querySelector(".popeye-modal"));
155158
if (_this.options.modalClass) {
@@ -229,6 +232,9 @@
229232
currentModal.close(value);
230233
}
231234
return currentModal;
235+
},
236+
isModalOpen: function() {
237+
return !!currentModal;
232238
}
233239
};
234240
}]

release/popeye.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/popeye.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)