diff --git a/js/soundmap.add.js b/js/soundmap.add.js index 53deb68..98c9551 100644 --- a/js/soundmap.add.js +++ b/js/soundmap.add.js @@ -63,15 +63,15 @@ initEvents: function(){ $('#add_files').bind('click', this.openMediaManager); wp.media.frames.file_frame.on('select',this.mediaSelected, this); - $('.delete-att-item').live('click', this.removeMedia); - setTimeout(() => { this.map.invalidateSize(); }, 0); + $('.att-info').on('click','.delete-att-item', this.removeMedia); + setTimeout(() => { this.map.invalidateSize(); }, 0); }, removeMedia: function(event){ $(event.currentTarget).parents('.soundmap-attach-item').remove(); }, openMediaManager: function(event){ - this.file_frame = wp.media.frames.file_frame + this.file_frame = wp.media.frames.file_frame event.preventDefault(); if ( this.file_frame ){ this.file_frame.open(); @@ -90,6 +90,7 @@ id: attachment.id }); $('#soundmap-attachments-list').append(_o); + $('.att-info').on('click','.delete-att-item', this.removeMedia); }, @@ -115,7 +116,7 @@ $(document).ready(function(){ - console.log($('#map_canvas').width()); + //console.log($('#map_canvas').width()); // Add Timeout for wait load metabox setTimeout(function() { soundmap.initMap(); diff --git a/soundmap.php b/soundmap.php index f57e3e8..0259871 100644 --- a/soundmap.php +++ b/soundmap.php @@ -81,12 +81,13 @@ if (!class_exists('Soundmap')){ function metaboxes_register_callback(){ add_meta_box('soundmap-map', __("Place the Marker", 'soundmap'), array($this, 'map_meta_box'), 'marker', 'normal', 'high'); - add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this,'soundmap_email_meta_box'), 'marker', 'side', 'low'); - add_meta_box('soundmap-sound-info', __("Info", 'soundmap'), array($this,'info_meta_box'), 'marker', 'side', 'high'); - add_meta_box('soundmap-sound-attachments', __("Media files attached.", 'soundmap'), array($this, 'attachments_meta_box'), 'marker', 'side', 'high'); + add_meta_box('soundmap-media-info', __("Info", 'soundmap'), array($this,'info_meta_box'), 'marker', 'side', 'high'); + add_meta_box('soundmap-media-attachments', __("Media files attached.", 'soundmap'), array($this, 'attachments_meta_box'), 'marker', 'side', 'high'); + // Ya no es necesario + //add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this, 'email_meta_box'), 'marker', 'side', 'low'); } //metaboxes_register_callback - function soundmap_email_meta_box(){ + function email_meta_box(){ global $post; $mail = get_post_meta($post->ID, 'EMAIL', TRUE); echo "
" . $mail . "
"; @@ -106,23 +107,19 @@ if (!class_exists('Soundmap')){ global $post; $files = get_post_meta($post->ID, 'soundmap_attachments_id', FALSE); - echo '