Explorar el Código

don't display collection add/delete buttons when js isn't enabled

Arnaud Le Blanc hace 13 años
padre
commit
bdf179686f

+ 1 - 0
Resources/public/base.js

@@ -1,4 +1,5 @@
 jQuery(document).ready(function() {
+    $('html').removeClass('no-js');
     Admin.add_pretty_errors(document);
     Admin.add_collapsed_toggle();
     Admin.add_filters(document);

+ 4 - 0
Resources/public/css/layout.css

@@ -230,3 +230,7 @@ body.sonata-bc {
     margin-top: 5px;
 }
 
+.no-js .sonata-collection-add, .no-js .sonata-collection-delete {
+    display: none;
+}
+

+ 1 - 1
Resources/views/standard_layout.html.twig

@@ -18,7 +18,7 @@ file that was distributed with this source code.
 {% set _title        = block('title') %}
 {% set _breadcrumb   = block('breadcrumb') %}
 <!DOCTYPE html>
-<html>
+<html class="no-js">
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />