Skip to content

Commit 14218fe

Browse files
author
Andrew Sullivan
committed
Merge branch 'Alex-Levacher-master'
2 parents 5aea94d + 303c933 commit 14218fe

5 files changed

Lines changed: 33 additions & 31 deletions

File tree

dist/angular-mapbox.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@
190190
controller.getMap().then(function(map) {
191191
transclude(scope, function(transcludedContent) {
192192
var popupContentElement;
193-
if(transcludedContent) {
193+
194+
if(transcludedContent !== null && transcludedContent.length > 0) {
194195
popupContentElement = document.createElement('span');
195196
for(var i = 0; i < transcludedContent.length; i++) {
196197
popupContentElement.appendChild(transcludedContent[i]);
@@ -276,7 +277,6 @@
276277
});
277278
})();
278279

279-
280280
(function() {
281281
'use strict';
282282

@@ -311,19 +311,21 @@
311311
scope.map.scrollWheelZoom.disable();
312312
}
313313

314-
var mapWidth = attrs.width || 500;
315-
var mapHeight = attrs.height || 500;
314+
if (attrs.autoSize === undefined ) {
315+
var mapWidth = attrs.width || 500;
316+
var mapHeight = attrs.height || 500;
316317

317-
if ( isNaN(mapWidth) ) {
318-
element.css('width', mapWidth);
319-
} else {
320-
element.css('width', mapWidth + 'px');
321-
}
318+
if ( isNaN(mapWidth) ) {
319+
element.css('width', mapWidth);
320+
} else {
321+
element.css('width', mapWidth + 'px');
322+
}
322323

323-
if ( isNaN(mapHeight) ) {
324-
element.css('height', mapHeight);
325-
} else {
326-
element.css('height', mapHeight + 'px');
324+
if ( isNaN(mapHeight) ) {
325+
element.css('height', mapHeight);
326+
} else {
327+
element.css('height', mapHeight + 'px');
328+
}
327329
}
328330

329331
scope.zoom = attrs.zoom || 12;
@@ -432,7 +434,7 @@
432434
controller.getMap().then(function(map) {
433435
transclude(scope, function(transcludedContent) {
434436
var popupContentElement;
435-
if(transcludedContent != null && transcludedContent.length > 0) {
437+
if(transcludedContent !== null && transcludedContent.length > 0) {
436438
popupContentElement = document.createElement('span');
437439
for(var i = 0; i < transcludedContent.length; i++) {
438440
popupContentElement.appendChild(transcludedContent[i]);
@@ -516,4 +518,3 @@
516518
}
517519
});
518520
})();
519-

0 commit comments

Comments
 (0)