Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"main": [
"js/ngPopover.js",
"js/ngPopover.min.js",
"css/ngPopover.css"
],
"license": "MIT",
Expand Down
38 changes: 21 additions & 17 deletions js/ngPopover.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var module = angular.module('ngPopover', []);
angular.module('ngPopover', [])

module.provider('ngPopover', function () {
.provider('ngPopover', function () {

var open = false;
var smallScreenBreakpoint = 500;
Expand Down Expand Up @@ -176,17 +176,22 @@ module.provider('ngPopover', function () {
if (!template) {
template = options.template || options.ngPopover;
}
var placement = options.placement || 'bottom';
var maximize = options.maximize || false;
var title = options.title || '';
var useParentWidth = options.useparentwidth || false;
var anchorSelector = options.anchorselector || '';
var maxWidth = options.maxwidth || null;

if (options.data) {
scope = scope.$new();
scope.rrData = options.data;
}
var placement = options.placement || 'bottom';
var maximize = options.maximize || false;
var title = options.title || '';
var useParentWidth = options.useparentwidth || false;
var anchorSelector = options.anchorselector || '';
var maxWidth = options.maxwidth || null;
var evalEl = options.evalEl || false;

if (options.data) {
scope = scope.$new();
if(evalEl){
scope.rrData = evalEl=='parent' ? scope.$parent.$eval(options.data) : scope.$eval(options.data);
}else{
scope.rrData = options.data;
}
}

var setupClick = function() {
$('body').append("<div id='ng-popover' style='display:none'>" +
Expand Down Expand Up @@ -259,10 +264,9 @@ module.provider('ngPopover', function () {
}
}
}]
});

})

module.directive('ngPopover', ['ngPopover', function(ngPopover) {
.directive('ngPopover', ['ngPopover', function(ngPopover) {

return {
restrict: 'A',
Expand All @@ -271,4 +275,4 @@ module.directive('ngPopover', ['ngPopover', function(ngPopover) {
}
}

}]);
}]);
2 changes: 1 addition & 1 deletion js/ngPopover.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.