Make WordPress Core


Ignore:
Timestamp:
10/29/2012 06:05:03 PM (13 years ago)
Author:
koopersmith
Message:

Add dynamic attachment view sizing. Removes the attachment view zooming in the process. see #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22323 r22324  
    13281328            <% } else if ( 'image' === type ) { %>
    13291329                <div class="thumbnail">
    1330                     <img src="<%- url %>" width="<%- width %>" height="<%- height %>" draggable="false"
    1331                     style="top:<%- top %>px; left:<%- left %>px;" />
     1330                    <img src="<%- url %>" draggable="false" />
    13321331                </div>
    13331332            <% } else { %>
     
    14621461        </div>
    14631462    </script>
     1463
     1464    <script type="text/html" id="tmpl-attachments-css">
     1465        <style type="text/css" id="<%- id %>-css">
     1466            #<%- id %> {
     1467                padding: <%- gutter %>px;
     1468            }
     1469
     1470            #<%- id %> .attachment {
     1471                margin: <%- gutter %>px;
     1472                width: <%- edge %>px;
     1473            }
     1474
     1475            #<%- id %> .attachment-preview,
     1476            #<%- id %> .attachment-preview .thumbnail {
     1477                width: <%- edge %>px;
     1478                height: <%- edge %>px;
     1479            }
     1480
     1481            #<%- id %> .portrait .thumbnail img {
     1482                width: <%- edge %>px;
     1483                height: auto;
     1484            }
     1485
     1486            #<%- id %> .landscape .thumbnail img {
     1487                width: auto;
     1488                height: <%- edge %>px;
     1489            }
     1490        </style>
     1491    </script>
    14641492    <?php
    14651493}
Note: See TracChangeset for help on using the changeset viewer.