Skip to content

Commit

Permalink
Merge pull request #13 from MST-Development/master
Browse files Browse the repository at this point in the history
Modal panel is overlay again
  • Loading branch information
bertalan committed Jul 25, 2015
2 parents 0b571a3 + 685b735 commit 2132cc1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 45 deletions.
24 changes: 12 additions & 12 deletions assets/js/asset.map.js
Expand Up @@ -95,23 +95,23 @@ function MMap() {

if ( marker === null ) continue;

var mcontent = "";
mcontent += "</h3>" + data[i].title + "</h3>";
mcontent += "<p>" + data[i].text + "</p>";
// var mcontent = "";
// mcontent += "</h3>" + data[i].title + "</h3>";
// mcontent += "<p>" + data[i].text + "</p>";

marker.bindPopup( mcontent );
// marker.bindPopup( mcontent );

this.markers.push( marker );

//marker.content = new Object();
//if ( data[i].title !== undefined ) marker.content.title = data[i].title;
//if ( data[i].text !== undefined ) marker.content.text = data[i].text;
marker.content = new Object();
if ( data[i].title !== undefined ) marker.content.title = data[i].title;
if ( data[i].text !== undefined ) marker.content.text = data[i].text;

//marker.on( 'click', function( e ) {
// $( '#mmap_modal_title' ).html( this.content.title );
// $( '#mmap_modal_body' ).html( this.content.text );
// $( '#mmap_modal' ).modal( 'show' );
//} );
marker.on( 'click', function( e ) {
$( '#mmap_modal_title' ).html( this.content.title );
$( '#mmap_modal_body' ).html( this.content.text );
$( '#mmap_modal' ).modal( 'show' );
} );
}
}
} );
Expand Down
62 changes: 29 additions & 33 deletions widgets/map/map.php
@@ -1,33 +1,29 @@
<?php

// no direct access to this file
defined( 'DACCESS' ) or die;

function mwidget_map( $zoom = 9, $cat_id = null ) {
global $content;
global $coords;

if ( MValidate::coord( $coords['lat'] ) && MValidate::coord( $coords['lng'] ) ) {
?>
<div id="mmap" style="width: 100%; height: 100%;"></div>
<script>
var mmap = new MMap();
mmap.set_lat( <?php MPut::_numeric( $coords['lat'] ) ?> );
mmap.set_lng( <?php MPut::_numeric( $coords['lng'] ) ?> );
mmap.set_zoom( <?php MPut::_numeric( $zoom ); ?> );
mmap.create_map( 'mmap' );

<?php if ( $content ): ?>
mmap.create_marker();
<?php endif; ?>

mmap.address_search();

var mmap_control = new MMapControl( mmap );
<?php if ( $cat_id ) echo 'mmap_control.auto_on( ' . intval( $cat_id ) . ' );'; ?>
</script>
<?php
}
}

?>
<?php
// no direct access to this file
defined( 'DACCESS' ) or die;
function mwidget_map( $zoom = 9, $cat_id = null ) {
global $content;
global $coords;
if ( MValidate::coord( $coords['lat'] ) && MValidate::coord( $coords['lng'] ) ) {
?>
<div id="mmap" style="width: 100%; height: 100%;"></div>
<script>
var mmap = new MMap();
mmap.set_lat( <?php MPut::_numeric( $coords['lat'] ) ?> );
mmap.set_lng( <?php MPut::_numeric( $coords['lng'] ) ?> );
mmap.set_zoom( <?php MPut::_numeric( $zoom ); ?> );
mmap.create_map( 'mmap' );
<?php if ( $content ): ?>
mmap.create_marker();
<?php endif; ?>

mmap.address_search();

var mmap_control = new MMapControl( mmap );
<?php if ( $cat_id ) echo 'mmap_control.auto_on( ' . intval( $cat_id ) . ' );'; ?>
</script> <div id="mmap_modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 id="mmap_modal_title" class="modal-title">Modal title</h4> </div> <div id="mmap_modal_body" class="modal-body"> Modal body </div> </div> </div> </div>
<?php
}
}

?>
Expand Down

0 comments on commit 2132cc1

Please sign in to comment.