Skip to content

Commit

Permalink
Merge branch 'Alex-Levacher-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sullivan committed Sep 7, 2015
2 parents 5aea94d + 303c933 commit 14218fe
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
31 changes: 16 additions & 15 deletions dist/angular-mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@
controller.getMap().then(function(map) {
transclude(scope, function(transcludedContent) {
var popupContentElement;
if(transcludedContent) {

if(transcludedContent !== null && transcludedContent.length > 0) {
popupContentElement = document.createElement('span');
for(var i = 0; i < transcludedContent.length; i++) {
popupContentElement.appendChild(transcludedContent[i]);
Expand Down Expand Up @@ -276,7 +277,6 @@
});
})();


(function() {
'use strict';

Expand Down Expand Up @@ -311,19 +311,21 @@
scope.map.scrollWheelZoom.disable();
}

var mapWidth = attrs.width || 500;
var mapHeight = attrs.height || 500;
if (attrs.autoSize === undefined ) {
var mapWidth = attrs.width || 500;
var mapHeight = attrs.height || 500;

if ( isNaN(mapWidth) ) {
element.css('width', mapWidth);
} else {
element.css('width', mapWidth + 'px');
}
if ( isNaN(mapWidth) ) {
element.css('width', mapWidth);
} else {
element.css('width', mapWidth + 'px');
}

if ( isNaN(mapHeight) ) {
element.css('height', mapHeight);
} else {
element.css('height', mapHeight + 'px');
if ( isNaN(mapHeight) ) {
element.css('height', mapHeight);
} else {
element.css('height', mapHeight + 'px');
}
}

scope.zoom = attrs.zoom || 12;
Expand Down Expand Up @@ -432,7 +434,7 @@
controller.getMap().then(function(map) {
transclude(scope, function(transcludedContent) {
var popupContentElement;
if(transcludedContent != null && transcludedContent.length > 0) {
if(transcludedContent !== null && transcludedContent.length > 0) {
popupContentElement = document.createElement('span');
for(var i = 0; i < transcludedContent.length; i++) {
popupContentElement.appendChild(transcludedContent[i]);
Expand Down Expand Up @@ -516,4 +518,3 @@
}
});
})();

Loading

0 comments on commit 14218fe

Please sign in to comment.