Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tables - Responsive #766

Open
StaggerLeee opened this issue Nov 15, 2016 · 4 comments
Open

Remove tables - Responsive #766

StaggerLeee opened this issue Nov 15, 2016 · 4 comments

Comments

@StaggerLeee
Copy link

StaggerLeee commented Nov 15, 2016

Is it possible to do something about it ?
Tables makes it impossible to style it better for smaller devices.

(If whole philosophy would change somehow it would be possible to use Metabox right-sidebar in backend. For now it is absolutely impossible, regarding how it looks. Maybe something like Mappress, 2 columns, not tables, 30% left columns for all values. Display block to be able to style them same way for phones. Right column 70% with map. Media queries for responsive and width of two columns changes accordinly.)

If you dont have time for it can you make file edit-form.php possible to override in theme folder: geo-mashup-edit-form.php ?

We can try to style it by ourself.
Some things I changed not to touch plugin core files. More cannot be done for now.

I already did change location-editor.css to be overirden:

add_action( 'admin_enqueue_scripts', 'remove_default_stylesheet', 100  );
function remove_default_stylesheet() {
    wp_dequeue_style( 'geo-mashup-edit-form' );
    wp_deregister_style( 'geo-mashup-edit-form' );

    wp_register_style( 'new-style', get_stylesheet_directory_uri() . '/location-editor.css', false, '1.0.0' ); 
    wp_enqueue_style( 'new-style' );
}

Here is another snippet for custom default coordinates and default zoom:

function geo_mashup_editor_map() {
  echo '<script type="text/javascript">
  (function($) {
		
$(function () {
    /* Specify the initial location/zoom level for the location editor map */
geo_mashup_location_editor.mapCreated.addHandler( function() {
      geo_mashup_location_editor.map.setCenterAndZoom( new mxn.LatLonPoint( 48.2206636,16.3100207 ), 16 );
} );
})
 
})(jQuery);
  </script>';
}
add_action( 'admin_head', 'geo_mashup_editor_map' );
@StaggerLeee
Copy link
Author

I styled it somehow and had plans to share new location-editor.css, but there is no point. Tables make it long from finished. And will never be possible to finish it.

Image of Yaktocat
Image of Yaktocat

@StaggerLeee
Copy link
Author

Small correction for snippet above. Better to use this one and limit snippet to post/page edit screens. It gives errors and problem in Geo Mashup Options screen.

function geo_mashup_editor_map() {
if( strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') ) {
  echo '<script type="text/javascript">
  (function($) {
$(function () {
    /* Specify the initial location/zoom level for the location editor map */
geo_mashup_location_editor.mapCreated.addHandler( function() {
      geo_mashup_location_editor.map.setCenterAndZoom( new mxn.LatLonPoint( 48.2206636,16.3100207 ), 16 );
} );
})
})(jQuery);
  </script>';
}
}
add_action( 'admin_head', 'geo_mashup_editor_map' );

@cyberhobo
Copy link
Owner

You should be able use the customization plugin to center the map.

I'd be happy to consider replacing the table HTML & CSS. A pull request would be the best way to come up with a good working alternative.

A bigger effort would be to just create a new and better location editor. Feel free to add ideas to that wiki page.

@StaggerLeee
Copy link
Author

Can you borrow some ideas from guy behind ACF plugin ? All his Metaboxes are without tables, even Google Map field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants